Listening for Paper resize events #1703
Replies: 2 comments 3 replies
-
|
Hi Alex, It's not a bug. The The paper transformations and paper dimensions are independent paper's attributes (see this demo). I don't think It's possible to distinguish this right now. You will have to override some of the PaperScroller methods for the time being. We might need to add higher-level events or allow passing flags along with paper events. e.g.: paperScroller.on('zoom', () => {});
paperScroller.on('auto-resize', () => {});or paper.on('resize', (width, height, flags) => {
if (flags.autoResize) {
/* */
}
});What action do you need to run when the paper is resized because of the content size and not when the PaperScroller zooms? I'd like to know some use-cases before we start implementing this. Thanks! |
Beta Was this translation helpful? Give feedback.
-
|
Hey Roman! I initialize the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi!
I'm currently using the
resizeevent in order to find out when my paper was resized either by callingsetDimensionsor because thePaperScrollerdecided it must resize it (autoResizePaper: true).My problem is that when I zoom the paper (by calling
PaperScroller.zoom) aresizeevent is triggered. I'm not expecting that, but I'm not sure if I'm understanding the docs incorrectly or if there is a bug inPaperScroller.To my understanding, zooming doesn't change the paper dimensions, it only changes the scale. If my assumption is incorrect, how can I listen only for actual dimension changes?
Beta Was this translation helpful? Give feedback.
All reactions