Children panels don't return their global position
-
@Christoph-Hart any possibilities here?
-
@ustk said in Children panels don't return their global position:
@Christoph-Hart any possibilities here?
cant you work it out form the parent position?
-
@Lindon This is a possibility indeed but I have children of children of children... making all this a bit convoluted
-
@ustk its just a recursive search backwards isnt it?
-
@ustk What about storing their positions as you add them? Then you can just look them up by ID.
-
@d-healey @Lindon Thanks guys, yep these ideas could work but I'm just letting this down because it's meant to be integrated into a browser, and the x position has to update since it is scrollable...
This was for making a panel following a child in the context of losing the focus we talked about 2 days ago
It works great for static components but is a pain for scrollable children so I'm going broadcaster instead of this hacky panels method -
@ustk Why not use a viewport?
-
@d-healey all of this is inside a viewport already, a logic approach for a browser
-
@d-healey I finally went with the broadcaster method and it works great even if I have 323 components connected...
-
@ustk That's a lot of children, you must be proud :p
-
@d-healey Actually the broadcaster isn't a solution... because it is also called from the components that are below the "label", making it react when it shouldn't (in my case lose the focus when you simply want to move the cursor or double-click).
That mouse click isn't "cut" when components are above
@Christoph-Hart were right, the focus system is a can of worm...