Skip to content
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

UI Element Delayed positioning when just parented #2602

Open
TranquilAbyss opened this issue Jan 23, 2025 · 0 comments
Open

UI Element Delayed positioning when just parented #2602

TranquilAbyss opened this issue Jan 23, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@TranquilAbyss
Copy link
Contributor

TranquilAbyss commented Jan 23, 2025

Release Type: Official Release/GitHub (please choose appropriate option)
Official Release

Version: Version number and/or git branch
4.2.0.2293

Platform(s): Does the problem occur on Windows, Android...?
Windows

Describe the bug
When UI is added in the Update loop to a existing Panel, through .Children.Add. It takes 2 update frames before position values are set.

To Reproduce
Steps to reproduce the behavior:

  1. New project
  2. Setup UIComponent with a empty Page
  3. Use the code in the image below
  4. Run project and stop project, then review immediate window.
    Image

Expected behavior
The first update frame has the margin updated added to the WorldMatrix.

Additional context

  • The SharpDX exception may or may not be related.
  • It will take three frames to setup positioning, even if the UIElement was added in later update frames.
  • Its also sometimes possible that this position update delay can cause a crash. When a Matrix with the following values on the second frame happens, but I don't know the steps to reproduce.
    [M11:1 M12:0 M13:0 M14:0] [M21:0 M22:1 M23:0 M24:0] [M31:0 M32:0 M33:1 M34:0] [M41:NaN M42:NaN M43:NaN M44:NaN]
    Moving the mouse while the WorldMatrix is in the above state become a problem since it can trigger an ArithmeticException on the Sign function trying to process a NaN value. This exception happens within the MouseOverChangedState functionality of the Stride UI.
@TranquilAbyss TranquilAbyss added the bug Something isn't working label Jan 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant