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

    billowy-waiter-28954

    02/01/2023, 2:05 PM
    @ambitious-knife-25690 Why in some cases you add the clipQuad to parentComponent's visual and sometimes to the local visual?
  • a

    ambitious-knife-25690

    02/01/2023, 2:10 PM
    root element doesn't have a parent so its null
  • a

    ambitious-knife-25690

    02/01/2023, 2:10 PM
    that situation should only ever occur once
  • a

    ambitious-knife-25690

    02/01/2023, 2:11 PM
    but if it does occur it will be a null error
  • a

    ambitious-knife-25690

    02/01/2023, 2:12 PM
    for the rest of the components they all work by adding to the parent
  • a

    ambitious-knife-25690

    02/01/2023, 2:13 PM
    I couldn't seem to get it to work if I had the clip rect added to itself
  • b

    bright-gpu-74537

    02/01/2023, 2:46 PM
    wont this.visual always be non-null though? Cant you just add the clipQuad regardless? I presume the clipping is basically like masking?
  • a

    ambitious-knife-25690

    02/01/2023, 2:50 PM
    that's what it seems like
  • a

    ambitious-knife-25690

    02/01/2023, 2:51 PM
    if I have the cliprect always set to
    this.clipRect
    then the button boxes/scrollviews don't work
  • b

    bright-gpu-74537

    02/01/2023, 2:52 PM
    i more mean, why not just this:
    Copy code
    haxe
                if (this.clipQuad == null) {
                    this.clipQuad = new Quad();
                    this.clipQuad.visible = true;
                    this.visual.add(clipQuad);
                }
  • a

    ambitious-knife-25690

    02/01/2023, 3:03 PM
    it results in this
  • a

    ambitious-knife-25690

    02/01/2023, 3:03 PM
    (adding the clip rect to
    this.visual
    )
  • b

    bright-gpu-74537

    02/01/2023, 3:04 PM
    oh, right, i see, in normal circumstances you are masking the parent
  • b

    bright-gpu-74537

    02/01/2023, 3:04 PM
    still not convinced that is correct though, i mean, the clip rect is supposed to apply to "this" component, not the parent
  • b

    bright-gpu-74537

    02/01/2023, 3:05 PM
    it may be why you are getting some oddities
  • b

    bright-gpu-74537

    02/01/2023, 3:06 PM
    how does ceramic know this quad is the for masking?
  • a

    ambitious-knife-25690

    02/01/2023, 3:06 PM
    by setting
    visual.clip
  • a

    ambitious-knife-25690

    02/01/2023, 3:06 PM
    this.clipQuad
    is a get/setter for that
  • b

    bright-gpu-74537

    02/01/2023, 3:07 PM
    gotcha
  • b

    bright-gpu-74537

    02/01/2023, 3:09 PM
    isnt it weird / wrong that in are setting this.visual.clip = x but then adding the clipQuad to the parent?
  • b

    bright-gpu-74537

    02/01/2023, 3:09 PM
    ie, shouldnt
    this.clipQuad = new Quad();
    be
    this.parentComponent.clipQuad = new Quad();
    ?
  • b

    bright-gpu-74537

    02/01/2023, 3:10 PM
    though it still seems off to me that you have to set it on the parentComponent, but maybe im not understanding something in the backend / ceramic
  • a

    ambitious-knife-25690

    02/01/2023, 3:11 PM
    i could try that
  • b

    billowy-waiter-28954

    02/01/2023, 3:11 PM
    it makes sense to have the clip quad in the parent
  • b

    billowy-waiter-28954

    02/01/2023, 3:11 PM
    because it's expected that a visual and the clipping quad used to clip the former share the same parent
  • a

    ambitious-knife-25690

    02/01/2023, 3:11 PM
    but setting an inside components clip quad to the parents main clip seems odd
  • b

    bright-gpu-74537

    02/01/2023, 3:12 PM
    right, that clears that up then 🙂
  • b

    bright-gpu-74537

    02/01/2023, 3:12 PM
    @billowy-waiter-28954 - i assume the parent of the clip and the visual should also be the same?
  • b

    bright-gpu-74537

    02/01/2023, 3:13 PM
    i think this is wrong, but not sure:
    Copy code
    haxe
                if (this.clipQuad == null) {
                    this.clipQuad = new Quad();
                    this.clipQuad.visible = true;
                    if (this.parentComponent != null) {
                        this.parentComponent.visual.add(clipQuad);
                    } else {
                        this.visual.add(clipQuad);
                    }
                }
  • a

    ambitious-knife-25690

    02/01/2023, 3:13 PM
    Copy code
    xml
    <vbox>
      <box width="20" height="20" />
      <box width="200" height="200" />
    </vbox>
    wouldn't the parent's clip be set to 200 x 200
1...145614571458...1687Latest