fix(IconManager) Fix icon frame x/y for auto packed icons #9928
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