ESOUI

ESOUI (https://www.esoui.com/forums/index.php)
-   General Authoring Discussion (https://www.esoui.com/forums/forumdisplay.php?f=174)
-   -   Control Anchors Bug? (https://www.esoui.com/forums/showthread.php?t=5543)

circonian 12/17/15 12:23 AM

Control Anchors Bug?
 
Has the game has always done this & I just never noticed or is this a bug?

If I anchor a control to guiRoot, in any way, say BOTTOMRIGHT to BOTTOMLEFT and then move the control around the screen it doesn't just update the offsets, but it also changes the anchor points. For example if I move the control near the top left corner of the screen the anchor becomes TOPLEFT to TOPLEFT, move it near the top right corner of the screen and it becomes TOPRIGHT to TOPRIGHT, exc..

If I resize the control it seems to change the anchor points as well. Dragging one side of the control seems to change the anchor to the side/direction your dragging it in. Grab the bottom of the control & drag it up and it reanchors TOP to TOP, grab the left side & drag it to the right and it reanchors RIGHT to RIGHT, exc...




It seems like a bug because if you use ResizeToFitDescendents the controls growth direction depends on its anchor so moving it around the screen causes the control to grow in different directions. As it stands I have to reanchor the controls every OnMoveStop so it keeps the correct anchors & grows in the correct direction.

merlight 12/17/15 05:15 PM

I don't know whether it's intended. What you describe kind of makes sense for a simple case. For example a box with a label that grows/shrinks with the contained text. If I put that box near the right edge, I expect it to grow to the left when the text gets longer, so that it doesn't run off the screen. If I place the box near the left edge, I expect it to grow to the right.

circonian 12/17/15 11:09 PM

Quote:

Originally Posted by merlight (Post 24779)
I don't know whether it's intended. What you describe kind of makes sense for a simple case. For example a box with a label that grows/shrinks with the contained text. If I put that box near the right edge, I expect it to grow to the left when the text gets longer, so that it doesn't run off the screen. If I place the box near the left edge, I expect it to grow to the right.

Yeah I thought about that and I can see situations where it could be useful like that, but it also means if you want it to grow in a certain direction you have to re-anchor it every time its moved. From the coders point of view I set the anchor point a certain way on purpose, I don't want the game changing them. Its kind of like saying the game knows better than I do so it will just do whatever it wants and re-anchor my controls however it thinks is best, which seems wrong to me.

Anyhow re-anchoring the controls at every OnMoveStop works, I was just curious if it had always done this & I never noticed.


All times are GMT -6. The time now is 03:36 AM.

vBulletin © 2024, Jelsoft Enterprises Ltd
© 2014 - 2022 MMOUI