-
Notifications
You must be signed in to change notification settings - Fork 239
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
Wait for other callbacks before load SVG code #755
Merged
Merged
Conversation
This file contains 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
poke |
paulkaplan
approved these changes
Nov 5, 2018
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
paulkaplan
added a commit
that referenced
this pull request
Nov 9, 2018
This reverts commit 2d27758.
scratch-deployer
pushed a commit
that referenced
this pull request
Aug 26, 2022
# 1.0.0 (2022-08-26) ### Bug Fixes * **deps:** update dependency scratch-l10n to v3.14.20220803031540 ([#2036](#2036)) ([4cc5fd2](4cc5fd2)) * **deps:** update dependency scratch-l10n to v3.14.20220804031609 ([#2037](#2037)) ([3d69b7b](3d69b7b)) * **deps:** update dependency scratch-l10n to v3.14.20220805031557 ([#2038](#2038)) ([b67acbb](b67acbb)) * **deps:** update dependency scratch-l10n to v3.14.20220806031552 ([#2039](#2039)) ([326ea51](326ea51)) * **deps:** update dependency scratch-l10n to v3.14.20220811031607 ([#2040](#2040)) ([4e4d3e4](4e4d3e4)) * **deps:** update dependency scratch-l10n to v3.14.20220812031537 ([#2041](#2041)) ([c150389](c150389)) * **deps:** update dependency scratch-l10n to v3.14.20220814031555 ([#2042](#2042)) ([93a4ce9](93a4ce9)) * **deps:** update dependency scratch-l10n to v3.14.20220815031546 ([#2043](#2043)) ([b7d41a9](b7d41a9)) * **deps:** update dependency scratch-l10n to v3.14.20220816031545 ([#2044](#2044)) ([93388f0](93388f0)) * **deps:** update dependency scratch-l10n to v3.14.20220817031614 ([#2045](#2045)) ([970b72c](970b72c)) * **deps:** update dependency scratch-l10n to v3.14.20220820031550 ([#2046](#2046)) ([61a99ef](61a99ef)) * **deps:** update dependency scratch-l10n to v3.14.20220821031607 ([#2047](#2047)) ([aba7c55](aba7c55)) * **deps:** update dependency scratch-l10n to v3.14.20220824031545 ([#2049](#2049)) ([81152d1](81152d1)) * **deps:** update dependency scratch-l10n to v3.14.20220825031548 ([#2050](#2050)) ([c3aa24d](c3aa24d)) * **deps:** update dependency scratch-l10n to v3.14.20220826031556 ([#2053](#2053)) ([1237592](1237592)) * **package:** update @scratch/paper to version 0.11.20180614155555 ([#514](#514)) ([672437b](672437b)) * **package:** update @scratch/paper to version 0.11.20180627210112 ([e806a37](e806a37)) * **package:** update @scratch/paper to version 0.11.20180717155250 ([cd99e72](cd99e72)) * **package:** update @scratch/paper to version 0.11.20180802201231 ([#581](#581)) ([500908a](500908a)) * **package:** update @scratch/paper to version 0.11.20181024192123 ([#734](#734)) ([c771a54](c771a54)), closes [#730](#730) * **package:** update @scratch/paper to version 0.11.20181029143421 ([#750](#750)) ([edb70f9](edb70f9)), closes [#749](#749) * **package:** update @scratch/paper to version 0.11.20190729152410 ([#872](#872)) ([12b6f88](12b6f88)) * **package:** update @scratch/paper to version 0.11.20200424212514 ([9f70f48](9f70f48)), closes [#1013](#1013) * **package:** update scratch-svg-renderer to version 0.2.0-prerelease.20180607141644 ([#500](#500)) ([760ddab](760ddab)), closes [#491](#491) * **package:** update scratch-svg-renderer to version 0.2.0-prerelease.20180613184320 ([e542d9a](e542d9a)) * **package:** update scratch-svg-renderer to version 0.2.0-prerelease.20180618172917 ([#517](#517)) ([46dc383](46dc383)) * **package:** update scratch-svg-renderer to version 0.2.0-prerelease.20180711180400 ([#552](#552)) ([0e51ec9](0e51ec9)) * **package:** update scratch-svg-renderer to version 0.2.0-prerelease.20180712223402 ([#555](#555)) ([df3192b](df3192b)), closes [#552](#552) * **package:** update scratch-svg-renderer to version 0.2.0-prerelease.20180817005452 ([#606](#606)) ([e93fc99](e93fc99)) * **package:** update scratch-svg-renderer to version 0.2.0-prerelease.20180907141232 ([#659](#659)) ([2b462eb](2b462eb)) * **package:** update scratch-svg-renderer to version 0.2.0-prerelease.20181017193458 ([#727](#727)) ([2e2c755](2e2c755)) * **package:** update scratch-svg-renderer to version 0.2.0-prerelease.20181024192149 ([#732](#732)) ([20059d4](20059d4)) * **package:** update scratch-svg-renderer to version 0.2.0-prerelease.20181126212715 ([#776](#776)) ([ada81cb](ada81cb)) * **package:** update scratch-svg-renderer to version 0.2.0-prerelease.20181213192400 ([#795](#795)) ([38ca8b9](38ca8b9)), closes [#794](#794) * **package:** update scratch-svg-renderer to version 0.2.0-prerelease.20181218153528 ([#802](#802)) ([b8b89c6](b8b89c6)) * **package:** update scratch-svg-renderer to version 0.2.0-prerelease.20190419183947 ([4f5af59](4f5af59)), closes [#815](#815) * **package:** update scratch-svg-renderer to version 0.2.0-prerelease.20190521170426 ([62cc3d9](62cc3d9)) * **package:** update scratch-svg-renderer to version 0.2.0-prerelease.20190523193400 ([1986093](1986093)) * **package:** update scratch-svg-renderer to version 0.2.0-prerelease.20190820171249 ([8ec1e4f](8ec1e4f)) * **package:** update scratch-svg-renderer to version 0.2.0-prerelease.20191031221353 ([bd0fadc](bd0fadc)) * **package:** update scratch-svg-renderer to version 0.2.0-prerelease.20191104164753 ([4c9bc9e](4c9bc9e)) * **package:** update scratch-svg-renderer to version 0.2.0-prerelease.20191217211338 ([616b0fb](616b0fb)) * **package:** update scratch-svg-renderer to version 0.2.0-prerelease.20200103191258 ([57863aa](57863aa)) * **package:** update scratch-svg-renderer to version 0.2.0-prerelease.20200205003400 ([3266038](3266038)), closes [#969](#969) * **package:** update scratch-svg-renderer to version 0.2.0-prerelease.20200507183648 ([625ee03](625ee03)) ### Reverts * Revert "Wait for other callbacks before load SVG code (#755)" ([dd35871](dd35871)), closes [#755](#755) * Revert "fix(package): update scratch-svg-renderer to version 0.2.0-prerelease.20181101210634 (#757)" ([e4e316f](e4e316f)), closes [#757](#757) * Revert "Fix issues handling rasters in reshape (#756)" ([003a09a](003a09a)), closes [#756](#756) * Revert "chore(package): update tap to version 12.0.1 (#586)" (#600) ([363fefd](363fefd)), closes [#586](#586) [#600](#600) * Revert "Don't enable if there is nothing in the editor" ([c9165b0](c9165b0)) * Revert "Revert "Add before deploy script that appends version"" ([7c84e5b](7c84e5b)) * Revert "remove the default imported costume" ([49b197e](49b197e)) * Revert "Make unimplemented buttons grey" ([1d0ffef](1d0ffef))
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.
Resolves
Fixes #557
Proposed Changes
This PR moves most of the code in the onLoad function for paper.project.importSvg into the window.setTimeout callback. (The diff isn't very helpful; it's mostly just code being moved)
Reason for Changes
Bitmaps shouldn't load in the wrong place and "jump"
Imported rasters in their onLoad function set their own size and position, which they didn't have available previously. However the way the callbacks are set up, the individual rasters' onLoad functions aren't called until after the global SVG's onLoad function (even though the rasters' "loaded" status is "true" by the time the SVG's onLoad is called). This would cause rasters to appear and then reposition. Moving the code into the window.setTimeout causes the initializeSvg function to run after the rasters are finished initializing themselves. The item is only added to the paper view after all positioning is finished.
Test Coverage
Tested loading projects 247578672 and 258120661