Page Index Toggle Pages: [1] 2 3  Send TopicPrint
Very Hot Topic (More than 25 Replies) Don't let the scroll bar restrict mouse drag of ShapeNode in Diagram (Read 18655 times)
D
Full Member
***
Offline


I Love MindFusion!

Posts: 158
Joined: Mar 16th, 2020
Don't let the scroll bar restrict mouse drag of ShapeNode in Diagram
Mar 30th, 2020 at 7:00am
Print Post  
Hey, Luybo Smiley

I don't want the scroll bar to limit the mouse drag of ShapeNode in Diagram. How can I solve it?
Is there any sample code?
  

3_30_1.png (Attachment deleted)
3_30_2.png (Attachment deleted)
Back to top
 
IP Logged
 
D
Full Member
***
Offline


I Love MindFusion!

Posts: 158
Joined: Mar 16th, 2020
Re: Don't let the scroll bar restrict mouse drag of ShapeNode in Diagram
Reply #1 - Mar 31st, 2020 at 6:49am
Print Post  
Added: Smiley
These two scroll bars will affect the normal drag of the ShapeNode in the diagram. I don't want this action to happen. How can I achieve this? And I want to delete this scroll bar.
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Don't let the scroll bar restrict mouse drag of ShapeNode in Diagram
Reply #2 - Mar 31st, 2020 at 7:00am
Print Post  
Hi,

Answered here how to hide the scroll bars:
https://mindfusion.eu/Forum/YaBB.pl?num=1585551814/2#2

About your other question, scroll bars don't restrict anything, they just show the extent of the diagram document and allow for navigation within it.

Regards,
Lyubo
MindFusion
  
Back to top
 
IP Logged
 
D
Full Member
***
Offline


I Love MindFusion!

Posts: 158
Joined: Mar 16th, 2020
Re: Don't let the scroll bar restrict mouse drag of ShapeNode in Diagram
Reply #3 - Mar 31st, 2020 at 7:38am
Print Post  
If there are no restrictions on the scroll bar, but why does it not drag to the right and drag down? I don’t want to let this happen, how can I solve it? Smiley
  

3_31_6.png (Attachment deleted)
Back to top
 
IP Logged
 
D
Full Member
***
Offline


I Love MindFusion!

Posts: 158
Joined: Mar 16th, 2020
Re: Don't let the scroll bar restrict mouse drag of ShapeNode in Diagram
Reply #4 - Mar 31st, 2020 at 8:09am
Print Post  
Is it because the picture is reduced to this extent? If this is the case, I want to restrict the picture to only shrink to the size of the picture itself. How to achieve this? Smiley
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Don't let the scroll bar restrict mouse drag of ShapeNode in Diagram
Reply #5 - Mar 31st, 2020 at 8:11am
Print Post  
Hi,

Again, scrollbars do not restrict anything, just like any scrollbar in any application ever. They indicate your viewport location in a bigger document and allow you to navigate in it.

In your example, you can't scroll anymore, because you've reached the edge of the diagram documents bounding rectangle - as you see at the top left corner, the ruler shows the point -500,-500, which is the corner of your diagram document. To be able to scroll more, you need to increase the size of the diagram Bounds.

Regards,
Lyubo
MindFusion
  
Back to top
 
IP Logged
 
D
Full Member
***
Offline


I Love MindFusion!

Posts: 158
Joined: Mar 16th, 2020
Re: Don't let the scroll bar restrict mouse drag of ShapeNode in Diagram
Reply #6 - Mar 31st, 2020 at 8:21am
Print Post  
Thank you, Lyubo, I fully understand. Smiley
I want to reduce the minimum size of the mouse wheel to the size of the image itself. How to achieve it?
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Don't let the scroll bar restrict mouse drag of ShapeNode in Diagram
Reply #7 - Mar 31st, 2020 at 10:36am
Print Post  
Do you mean zooming in?
  
Back to top
 
IP Logged
 
D
Full Member
***
Offline


I Love MindFusion!

Posts: 158
Joined: Mar 16th, 2020
Re: Don't let the scroll bar restrict mouse drag of ShapeNode in Diagram
Reply #8 - Mar 31st, 2020 at 10:41am
Print Post  
Yes, I want to minimize zooming in to the size of the image itself
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Don't let the scroll bar restrict mouse drag of ShapeNode in Diagram
Reply #9 - Mar 31st, 2020 at 10:54am
Print Post  
Try this:
Code
Select All
        private void OnDiagramMouseWheel(object sender, MouseWheelEventArgs e)
        {
            var zoomRect = diagram.Viewport;
            if (e.Delta < 0)
                zoomRect.Inflate(10, 10);
            else
                zoomRect.Inflate(-10, -10);
            if (diagram.Bounds.Width >= zoomRect.Width && diagram.Bounds.Height >= zoomRect.Height &&
                zoomRect.Contains(imageNode.Bounds))
                diagram.ZoomToRect(zoomRect, true);

            // stop the scrollviewer from scrolling
            e.Handled = true;
        } 



Regards,
Lyubo
MindFusion
  
Back to top
 
IP Logged
 
D
Full Member
***
Offline


I Love MindFusion!

Posts: 158
Joined: Mar 16th, 2020
Re: Don't let the scroll bar restrict mouse drag of ShapeNode in Diagram
Reply #10 - Mar 31st, 2020 at 11:05am
Print Post  
Yes, it worked. thank you, Lyubo. Wink if it is zooming out, I want to minimize zooming out to the picture itself. How can I modify it?
  
Back to top
 
IP Logged
 
D
Full Member
***
Offline


I Love MindFusion!

Posts: 158
Joined: Mar 16th, 2020
Re: Don't let the scroll bar restrict mouse drag of ShapeNode in Diagram
Reply #11 - Mar 31st, 2020 at 1:02pm
Print Post  
Hi Lyubo, I have been waiting for your answer Smiley
  
Back to top
 
IP Logged
 
Lyubo
God Member
*****
Offline


MindFusion team

Posts: 511
Joined: Jun 17th, 2010
Re: Don't let the scroll bar restrict mouse drag of ShapeNode in Diagram
Reply #12 - Apr 1st, 2020 at 5:03am
Print Post  
Hi,

Sorry, but I don't really understand what you mean, because in its current form, your request doesn't make sense. You can't simultaneously limit zoom in and out on the same object and still have the zoom interaction. You need to either clarify your question or adjust your requirements.

Regards,
Lyubo
MindFusion
  
Back to top
 
IP Logged
 
D
Full Member
***
Offline


I Love MindFusion!

Posts: 158
Joined: Mar 16th, 2020
Re: Don't let the scroll bar restrict mouse drag of ShapeNode in Diagram
Reply #13 - Apr 1st, 2020 at 6:04am
Print Post  
Smiley Sorry, Lyubo,
I wanted to say zooming-out last time, but the result:(zooming in) was sent to you. My requirement is that the minimum degree of zooming-out is the image size.How to achieve it?
« Last Edit: Apr 1st, 2020 at 3:11pm by D »  
Back to top
 
IP Logged
 
D
Full Member
***
Offline


I Love MindFusion!

Posts: 158
Joined: Mar 16th, 2020
Re: Don't let the scroll bar restrict mouse drag of ShapeNode in Diagram
Reply #14 - Apr 2nd, 2020 at 12:40am
Print Post  
Hello, I have been waiting for your answer Smiley
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: [1] 2 3 
Send TopicPrint