This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hi, I have a problem with the view port frame, when I move the frame inside the minimap, sometimes the main diagram will zoom in (become very large), how can I prevent the main diagram zooming automatically, I only want the main diagram zoom when the user want. To reproduce this problem, you can only drop one node to the main diagram, and then try to move the frame inside the minimap.(see picture1) second problem, If I scroll down the main diagram view to some distance, the frame will become smaller and smaller, and then totally disappear, and if I scroll up for a while, the frame will appear again, and then I move the frame, and find out the size of frame doesn't cover the main diagram visible part.(see picture2, picture3). I also attached my project. Thanks |
|
|
Hello jzhou To prevent the viewport frame from effecting the zoom, go to ViewportFrameControl and find the line that creates the newViewPort. (about line 130). Just before this line, get the current viewport of the main diagram and store it in a variable like this:
Now when creating the newViewPort, rather than passing in the factorized width and height, simply maintain the current with and height. This will keep the zoom level the same, and only pan the chart.
For your second problem, the viewport frame disappearing when you scroll outside the diagram bounds is the expected behavior. Keep in mind that the bounds of the minimap are constrained to the smallest rectangle that fits the diagram, where as the main diagram surface can scroll to infinity in all directions. This means if you scroll outside the bound of the main diagram surface, the viewport frame does not logically fit within the minimap bounds. you could of course change the behavior of your ViewportFrameControl to always keep some of the frame within the minimap bounds, but then when the user moves the frame, the main diagram will suddenly jump to within the bounds of the diagram. Let me know if you want to change the behavior but need some help. As for the viewport frame being the wrong place when it scrolls back into view, I couldn't reproduce this after I had resolved your first issue, so this is probably also resolved. Let me know if the problem remains after you have implemented the steps I mentioned for the first problem. Jason Fauchelle |
|
|
Hello Jason, Thanks for your help, the first problem is fixed with your code, I think the current behavior of the view port is fine. Thanks |
|