-
Notifications
You must be signed in to change notification settings - Fork 857
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
[Bug]: Erratic behavior of paper scroller when adjusting paper #2215
Comments
The I quickly tried to start listening not only to It depends on what you want to achieve. If you want to define a different initial paper size and increment size, I recommend the following: contentOptions: () => {
const minArea = new g.Rect(0, 0, 2000, 1000);
const contentArea = minArea.union(graph.getBBox());
return {
contentArea
}
} |
I would like to resize the paper while having a base (min size) - so your solution works. Thank you. However, the initial jump (scroll) still occurs when dragging an item. It happens only when:
Calling any scroll methods on it, such a EDIT: Actually, I just realized that it still has some issues but I am not sure whether it is related to the navigator or the scroller. |
It should happen automatically but it does not. If I remember correctly, the problem is we don't know when the paper scroller is attached to the DOM (you can set the scrollbars while the container is not in the DOM). It requires a breaking change (for instance throw an error if you try to call
How to reproduce that? For instance in the Kitchen Sink application? |
That makes sense. Would be nice to point it out in the docs, tho.
With the code from my first post, just replace the paperScroller with let paperScroller = new ui.PaperScroller({
autoResizePaper: true,
scrollWhileDragging: true,
baseWidth: 500,
baseHeight: 500,
paper,
contentOptions: () => {
const minArea = new g.Rect(0, 0, 2000, 1000);
const contentArea = minArea.union(graph.getBBox());
return {
contentArea
};
}
}); Then:
You should be able to see the flashing/size changes of the paper in the navigator. |
Thank you. I am able to reproduce it now. The Navigator seems to work as expected. The problem lies within the PaperScroller that resizes the paper in a wrong way after the zoom. We'll look into it. Please bear with us. |
What happened?
Hi everybody (Roman :) ),
So I am trying to use the paper scroller's
autoResizePaper
functionality and it "kinda" works but it seems to behave quite erratically. Here is a quick test file (set up for the Test case 3 from below it):Case 1:
- paper size is 2000 x 2000, no sizes set on the paper scroller
Dragging the circle upwards to the top-edge of the paper moves it close to the center of the paper, below the rectangle.
- changing the paper size to 2000 x 1000
Kinda same result.
There seems to be a jump after the paper scroller adjust the paper which moves the visible area and that causes the element to appear at incorrect x/y.
Case 2:
- paper size is 2000 x 1000, paper scroller
baseWidth
andbaseHeight
are 2000 and 1000, so same as the paperJump still occurs. Seems like it is there always on first adjust.
Case 3:
- paper size is 2000 x 1000, paper scroller
baseWidth: 500
,baseHeight: 200
,contentOptions: { minWidth: 2000, minHeight: 1000, allowNewOrigin: ‘any’ }
This is probably the worst case of these three. Huge jumps sometimes with big distances. Sometimes moving the element a bit puts it to turbo-speed. Sometimes I “lose” the circle from the navigator. Navigator doesn’t show the correct size.
E.g. these result can be produced imgur (pls excuse the circle label saying 'Rectangle', copy & paste & didn't realize)
Am I doing something wrong? Am I not setting something that should be set or setting something that should be set? I can't see anything very obvious and imho this setup should work.
Is this a bug on the paperscroller?
Version
jointjs+ 3.7
What browsers are you seeing the problem on?
Chrome
What operating system are you seeing the problem on?
Mac
The text was updated successfully, but these errors were encountered: