-
Notifications
You must be signed in to change notification settings - Fork 93
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: sdk7 ui text position #5884
Conversation
…e based on root element
After the CI passes: WebThis branch can be previewed at:
Desktop:If you have the launcher installed (download launcher) you can press open on the following link: SDK 6/7:More |
…into fix/sdk7-ui-text-position
@@ -10,7 +10,7 @@ public static void SetElementDefaultStyle(IStyle elementStyle) | |||
elementStyle.bottom = 0; | |||
elementStyle.width = new StyleLength(StyleKeyword.Auto); | |||
elementStyle.height = new StyleLength(StyleKeyword.Auto); | |||
elementStyle.position = new StyleEnum<Position>(Position.Relative); | |||
elementStyle.position = new StyleEnum<Position>(Position.Absolute); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mm its weird.
We are sending the position: relative by default on the sdk level 🤔
https://github.com/decentraland/js-sdk-toolchain/blob/main/packages/%40dcl/react-ecs/src/components/uiTransform/index.ts#L37
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that change right now only affects the UiText, and it only affects the inner visual element of the UiText.
Some UiComponents we create are actually composed of 2 visual elements: a root element that acts as a kind of container and an inner one. UiText has a container and a label as the child, that absolute setting affects the Label.
We were already setting this as Absolute before I implemented the auto-size support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* Reverted initial position type for ui text * Added position type update based on root element (only affects ui text for now)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot summary
🤖 Generated by Copilot at 2cf7646
Refactor the UI system to fix layout issues and simplify UI element creation. Change the default position of UI elements to absolute and add a condition for auto width or height in
UIElementHandlerBase.cs
. Move theSetElementDefaultStyle
method fromUiElementUtils.cs
toUIElementHandlerBase.cs
.QA TEST INSTRUCTIONS