You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
View.update() (redraw cycle) is called once when it has imported/processed all 10 Rasters
Actual Result
View.update() (redraw cycle) is called 10 times(for each Raster) during the importJSON() "process".
Device/Browser
Evergreen browsers
So, here's a demonstrable example on Codepen, where the console logs that view.update() is called 10 times when importing a 10 Raster json.
Working with paper-full.js,
I've put a console.log() in View.update() in paper-full.
I create a project with 10 Rasters, export it with exportJSON() and then reimport it with importJSON().
view.update() is logged in the console 10 times (was called 10 times).
calls to view.update() seem to be coming from Raster's setSource() in line 4844.
Why does the redraw cycle kick-in for each Raster when importing? I'm posting this cause it's a bit of an expensive operation when shuffling Raster json's around and it decimates the experience. Is it really necessary?
Plus this happens only when importing json's with Rasters.
When project has 10 Path items it is improrted with view.update() being called just once when it's done, just as expected.
The text was updated successfully, but these errors were encountered:
I need to find a way to know when these updates are desired and when not... #827 is a related issue also, since all images being loaded should trigger the load event of the SVG import call... It's complicated!
I've temporarily solved it by using a debouncer() to collapse all those calls into a single one. Bit of a crude workaround but for now it patches things up.
Test case
Rasters
on a project, callexportJSON()
project.clear()
, the projectExpected Result
View.update()
(redraw cycle) is called once when it has imported/processed all 10 RastersActual Result
View.update()
(redraw cycle) is called 10 times(for each Raster) during theimportJSON()
"process".Device/Browser
So, here's a demonstrable example on Codepen, where the console logs that
view.update()
is called 10 times when importing a 10 Raster json.Working with
paper-full.js
,console.log()
inView.update()
in paper-full.Rasters
, export it withexportJSON()
and then reimport it withimportJSON()
.view.update()
is logged in the console 10 times (was called 10 times).view.update()
seem to be coming from Raster'ssetSource()
inline 4844
.Why does the redraw cycle kick-in for each Raster when importing? I'm posting this cause it's a bit of an expensive operation when shuffling Raster json's around and it decimates the experience. Is it really necessary?
Plus this happens only when importing json's with Rasters.
When
project
has 10 Path items it is improrted withview.update()
being called just once when it's done, just as expected.The text was updated successfully, but these errors were encountered: