fix(IconManager) Fix icon frame x/y for auto packed icons#9928
Merged
felixpalmer merged 8 commits intovisgl:masterfrom Jan 16, 2026
Merged
fix(IconManager) Fix icon frame x/y for auto packed icons#9928felixpalmer merged 8 commits intovisgl:masterfrom
felixpalmer merged 8 commits intovisgl:masterfrom
Conversation
Contributor
Author
|
@Pessimistress could you review this, since I think you'll have the most SA based on #7651? |
felixpalmer
approved these changes
Jan 7, 2026
|
|
||
| private _onUpdate(): void { | ||
| this.setNeedsRedraw(); | ||
| this.getAttributeManager()?.invalidate('getIcon'); |
Collaborator
There was a problem hiding this comment.
This is an expensive operation called on every icon image load. Pass a flag to onUpdate for whether icon frame is changed?
felixpalmer
pushed a commit
that referenced
this pull request
Jan 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
When auto packing is enabled, the icon manager must reserve space for the width/height declared by the icon definition, even before icon is loaded. After an icon loads, it is resized and centered in that reserved space/box. #7651 fixed a bug where the icon image itself would be stretched to completely fill the box, distorting the icon if it had an aspect ratio which differed from that of the box. However, for the icon mapping that the icon manager returns, that PR only updated the width/height fields, and not the x/y. So when retrieving a mapping, an icon frame would be returned with the correct size, but not centered where the actual icon is, resulting in icons not displaying properly.
Change List