unity-flex-ui
unity-flex-ui copied to clipboard
Selecting GameObject with FlexLayout sometimes adds 100px to layout properties
Issue
Occasionally, selecting a GameObject with a FlexLayout component causes 100px to be added to one of the size properties (height, minHeight, maxHeight or width, minWidth, maxWidth), depending on the flex direction.
Details
- Happens with some GameObjects, not consistently.
- Whether it happens to
widthorheightseems tied to the flex direction (row vs column). - Can occur both in edit mode and at runtime.
Example
Before selecting Time Attack element:
After selecting/clicking on Time Attack element:
Hi @alexanderlarsen, thanks for the report. That's really weird 🤔
Happens with some GameObjects, not consistently.
Maybe there's some other component in them that could be messing with the FlexLayout? The only place in FlexLayout that changes Width / Height "automatically" is Reset, which is a standard Unity message called when the component is first added, or when you click "Reset" in its context menu. Since you also have min/max width/height being affected as well, I guess it's not that.
Can attach a debugger to Unity with a breakpoint in the setter of Width or Height properties and check what's the stacktrace when you select such GameObjects, so we have more information on what's going on?