https://linen.dev logo
Join Discord
Powered by
# haxe-ui
  • b

    bright-gpu-74537

    01/26/2023, 1:00 PM
    OK, so the scrollbars work, but my guess is that you havent implemented handleClipRect correctly for cermic... you might need to move the component up / down
  • a

    ambitious-knife-25690

    01/26/2023, 1:01 PM
    well, it was a bit weird
  • a

    ambitious-knife-25690

    01/26/2023, 1:01 PM
    handlecliprect returned a rectanglee with a static left/right of 0,0
  • a

    ambitious-knife-25690

    01/26/2023, 1:01 PM
    Copy code
    hx
        override function handleClipRect(value:Rectangle):Void {
            if (value == null) {
                this.clipQuad = null;
            } else {
                if (this.clipQuad == null) {
                    this.clipQuad = new Quad();
                    this.clipQuad.visible = false;
                }
                
                this.clipQuad.x = surface.x + parentComponent.surface.x;
                this.clipQuad.y = surface.y + parentComponent.surface.y;
                this.clipQuad.width = value.width;
                this.clipQuad.height = value.height;
            }
        }
  • a

    ambitious-knife-25690

    01/26/2023, 1:02 PM
    this is what i have currently
  • b

    bright-gpu-74537

    01/26/2023, 1:02 PM
    it shouldnt, not while its scrolling
  • a

    ambitious-knife-25690

    01/26/2023, 1:02 PM
    ahah
  • a

    ambitious-knife-25690

    01/26/2023, 1:02 PM
    i neglected that so i left it out
  • b

    bright-gpu-74537

    01/26/2023, 1:02 PM
    when its scrolling, for example, down, i would expect value.x (or .top) to change
  • b

    bright-gpu-74537

    01/26/2023, 1:03 PM
    i think you have the clip right tbh, you might just need to move the surface up or something
  • b

    bright-gpu-74537

    01/26/2023, 1:03 PM
    you'll probably need to play a little - clip rects can be a pain since most frameworks seem to do "their own thing"... so cant help that much
  • b

    bright-gpu-74537

    01/26/2023, 1:03 PM
    good luck! 🙂
  • a

    ambitious-knife-25690

    01/26/2023, 1:17 PM
    Hey Ian
  • a

    ambitious-knife-25690

    01/26/2023, 1:17 PM
    I noticed on some other backends you create a clip quad every frame
  • a

    ambitious-knife-25690

    01/26/2023, 1:17 PM
    is that intentional/does the backend have it's own way to handle that?
  • a

    ambitious-knife-25690

    01/26/2023, 1:18 PM
    Copy code
    hx
        private override function handleClipRect(value:Rectangle):Void {
            if (value == null) {
                this.scrollRect = null;
            } else {
                this.scrollRect = new openfl.geom.Rectangle(Math.fround(value.left),
                                                            Math.fround(value.top),
                                                            Math.fround(value.width),
                                                            Math.fround(value.height));
            }
  • a

    ambitious-knife-25690

    01/26/2023, 1:18 PM
    like openfl backend does this
  • a

    ambitious-knife-25690

    01/26/2023, 1:18 PM
    so every frame a new rectangle is being created, rather than just reusing the existing one
  • a

    ambitious-knife-25690

    01/26/2023, 1:21 PM
    seems quite bad cause cliprect is being called every frame idly
  • a

    ambitious-knife-25690

    01/26/2023, 1:26 PM
    dang it so close 😅
  • b

    bright-gpu-74537

    01/26/2023, 1:30 PM
    handleClipRect isnt called every frame
  • a

    ambitious-knife-25690

    01/26/2023, 1:32 PM
    it is for me 🤔
  • a

    ambitious-knife-25690

    01/26/2023, 1:33 PM
    (17709) haxe\ui\backend\ComponentImpl.hx:80: here
  • b

    bright-gpu-74537

    01/26/2023, 1:33 PM
    you mean if you trace on handleClipRect it just sits there tracing?
  • a

    ambitious-knife-25690

    01/26/2023, 1:33 PM
    yeah
  • b

    bright-gpu-74537

    01/26/2023, 1:33 PM
    defo seems wrong
  • a

    ambitious-knife-25690

    01/26/2023, 1:33 PM
    some of the things i tried, once i let go of the mouse button
  • a

    ambitious-knife-25690

    01/26/2023, 1:33 PM
    the clip/surface would infinitely keep moving
  • b

    bright-gpu-74537

    01/26/2023, 1:37 PM
    its certainly not called over and over again... nor should it... so its something off in your backend
  • a

    ambitious-knife-25690

    01/26/2023, 1:37 PM
    I never manually call handlecliprect tho o_o
1...141614171418...1687Latest