Set SVG skin size synchronously #497
Merged
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.
Resolves
Solves
SVGSkin
s' size staying small; subsequently supersedes #496, #486This PR fixes SVG costumes' size showing as 0x0 in the editor, which was causing the GUI's SVG costume integration tests to fail as they were specifically searching for the string
100 x 100
.Proposed Changes
This PR re-merges "Skin alter push", but changes
SVGSkin.setSVG()
to set the costumesize
outside of theSVGRenderer
callback rather than inside it.It also includes a minor change (previously #486), which swaps the order of setting the skin
size
and callingcalculateRotationCenter
. This fixes calculated rotation centers.Reason for Changes
The VM expects the skin size to be properly set immediately after calling
updateSVGSkin
, as it sets the costume size to the skin size after calling it. If the skin size is only set after the SVG renderer callback fires, the SVG costume size will appear as 0x0 in the editor.Test Coverage
This appears to be, in a way, tested for in the GUI. A more explicit test over there might be a good idea.