Search Unity

[UIElements] GraphView ignores margin for selection rectangle.

Discussion in 'UI Toolkit' started by Devi-User, Oct 11, 2018.

  1. Devi-User

    Devi-User

    Joined:
    Apr 30, 2016
    Posts:
    61
    GraphView ignores margin for selection rectangle.
    On the attached gif, you can see what GraphView does if it adds a margin to the element itself, or to its contentContainer
     

    Attached Files:

  2. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,231
    If the selection rectangle has a margin, it's (0,0) is the edge of that margin, which explains the offset you see. That's "by design". The question now is, why does the selection rectangle need a margin?
     
  3. Devi-User

    Devi-User

    Joined:
    Apr 30, 2016
    Posts:
    61
    I just think it is incorrect behavior that the selection rectangle is shifted relative to the cursor when we specify the margin and decided to report it here.
     
  4. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,231
    Making the selection rectangle not appear shifted in the case it has a margin would break other uses of margin where the expectation is that the top right corner (0,0) of an element includes the margin. I'm still curious why you're adding a margin on the selection rectangle. It's an absolute positioned element so the margin does nothing for it.
     
  5. benoitd_unity

    benoitd_unity

    Unity Technologies

    Joined:
    Jan 2, 2018
    Posts:
    331
    FYI, we now have a dedicated sub-forums where you can use for all your questions and feedback related to UI Systems Previews.

    Cheers,