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

fix: UI overridden margin in derived controls being reset #2310

Merged
merged 2 commits into from
Jun 7, 2024

Conversation

Basewq
Copy link
Contributor

@Basewq Basewq commented Jun 6, 2024

PR Details

As per #2048, Margin is a struct Thickness, with itself holding float fields (Left, Right, etc).
If an object has a Thickness struct as a field/property and you override it in a derived asset, it is marked as overridden, however the fields of the Thickness are not marked overridden.
When AssetPropertyGraph encounters the Thickness's fields it was not aware its parent has been marked overridden so it mistaken itself as not overridden and overwrites itself with the value from the base asset.

This change ensures any encountered member (field/property) that is a value type must check if it is part of another value type that may be marked overridden, and reject taking the base asset's value if this is the case.

2nd commit is to fix some typos.

Related Issue

Fixes #2048

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • I have built and run the editor to try this change out.

@Eideren Eideren merged commit c1b36e1 into stride3d:master Jun 7, 2024
12 of 14 checks passed
@Eideren
Copy link
Collaborator

Eideren commented Jun 7, 2024

Looks great, thanks !

@Eideren Eideren added the area-UI label Jun 7, 2024
@Eideren Eideren changed the title Fix UI overridden margin in derived controls being reset fix: UI overridden margin in derived controls being reset Jun 7, 2024
@Basewq Basewq deleted the ui_margin_fix branch June 8, 2024 08:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UI library margins reset to zero
2 participants