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.
-
Hi!
I'm currently using the
resize
event in order to find out when my paper was resized either by callingsetDimensions
or because thePaperScroller
decided it must resize it (autoResizePaper: true
).My problem is that when I zoom the paper (by calling
PaperScroller.zoom
) aresize
event 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