Closed ArthurWietzorek closed 3 months ago
I am not aware of such a change.
The render:done
should not be triggered if there is nothing to update (such as updating a custom top-level attribute).
I will need steps to reproduce as this does not fire render:done
event.
paper.on('render:done', (o) => console.log('render:done', o));
paper.freeze();
paper.model.getElements()[0].set('myattribute', 1);
paper.unfreeze();
// No `render:done` is triggered in v3.6
Applying a zoom and center to the PaperScroller before the Paper is done rendering does not work?
Why does not this work? What exactly do you do? Updates to the paper do not change the zoom or the center of the visible area in the paper scroller.
You are right, after further search i found that our application did re-initialize the entire graph and therefore cause changes that would require another render, which it no longer does now.
Updates to the paper do not change the zoom or the center of the visible area in the paper scroller.
I do not know why this does not work in our case, but i will research that and open a different issue if i can find something wrong.
I will close this issue as it was simply a mistake on our part and not a bug in JointJS after all. Thank you very much!
Current versus expected behaviour
We are currently updating our application from JointJS 3.6.5 to 4.0.4. In our application we use the
paper.freeze()
function to keep the state of the Paper while displaying other UI elements and thenpaper.unfreeze()
once the PaperScroller has been appended to an HTML element in the DOM tree again.Before unfreezing we listen to
paper.once('render:done', ...)
to apply the same PaperScroller zoom and center as before the user left. This worked perfectly fine before updating, but now the 'render:done' event is sometimes not emitted.While the Paper is frozen we use a different UI to update various properties of the Elements and Links, not all of them leading to actual changes in the SVG to be displayed. It seems to be the case that the 'render:done' event is now only emitted when the changes made while the Paper was frozen would actually cause a difference in the resulting SVG.
Was this an intended change made to that event? Is there a workaround for us? Applying a zoom and center to the PaperScroller before the Paper is done rendering does not work, there is no other event to listen to and setting a timeout to apply those changes is not a stable solution.
Steps to reproduce
(I am still working on reproducing this problem in the Kitchensink and will update this issue later)
Version
4.0.4
What browsers are you seeing the problem on?
Firefox, Chrome
What operating system are you seeing the problem on?
Windows, Linux