Search Unity

[UIElements] GraphView ignores margin for selection rectangle

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

  1. Devi-User

    Devi-User

    Joined:
    Apr 30, 2016
    Posts:
    61
    duplicate the topic. start discussion here: https://forum.unity.com/threads/uielements-graphview-ignores-margin-for-selection-rectangle.567931/

    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


    https://forum.unity.com/attachments/f2181298-f2a0-44f3-9740-6a3c04555461-gif.315547/

    I heard an argument that GraphView and its contentContainer have absolute positioning. But it is not. I added a margin and background-color to them without any problems and watched the appearance of the border and offset. However, the selection rectangle shifts and is not under the cursor.
     
  2. uDamian

    uDamian

    Unity Technologies

    Joined:
    Dec 11, 2017
    Posts:
    1,231
    To confirm, which element specifically did you add a margin to to get this bug?

    If you added it to GraphView, or its contentContainer, and it offset the selection rectangle then this might be a bug. You can send it in to support, just keep in mind GraphView is not a supported API (it is Experimental). It will not even go public at the same time as UIElements and it is primarily used internally.
     
  3. Devi-User

    Devi-User

    Joined:
    Apr 30, 2016
    Posts:
    61
    It is a pity, in the future it would be good. Well, then I will not look in the direction of using it.