Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Issue with DiagramView alignment within Ruler. (Read 656 times)
nullable
Full Member
***
Offline


I Love MindFusion!

Posts: 118
Joined: Aug 25th, 2022
Issue with DiagramView alignment within Ruler.
Oct 14th, 2024 at 12:30pm
Print Post  
Please refer to the projects that I've attached in the previous topic, as I also have some issues with scroll and ruler alignment. Before the update Diagram was aligned at the center by default, with the scroll bar being attached to the right side of the ruler and coordinates of the ruler were bound to the diagram.
But in the latest version if I use DiagramView, it is aligned to the left, and if I change the alignment to center, the ruler coordinates will not synchronize, and the scroll bar will be attached to the diagram directly, not to the right side of the ruler.
Could you please tell me, how to get the same alignment as it was before the last version?
  

BeforeUpdate.png ( 220 KB | 30 Downloads )
BeforeUpdate.png
AfterUpdate.png ( 199 KB | 28 Downloads )
AfterUpdate.png
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3343
Joined: Oct 19th, 2005
Re: Issue with DiagramView alignment within Ruler.
Reply #1 - Oct 15th, 2024 at 10:45am
Print Post  
Ruler sets hosted view's HorizontalAlignment and VerticalAlignment to Stretch internally, and we haven't really considered situations where you'd be changing them to Center. We'll review these for next release. Difference from previous version is placing a ScrollViewer (also stretch-aligned) between itself and the Diagram instance, and that ScrollViewer apparently centering the diagram by default.

Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
nullable
Full Member
***
Offline


I Love MindFusion!

Posts: 118
Joined: Aug 25th, 2022
Re: Issue with DiagramView alignment within Ruler.
Reply #2 - Oct 16th, 2024 at 6:26am
Print Post  
It would be also nice to know ETA of your next release.
  
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3343
Joined: Oct 19th, 2005
Re: Issue with DiagramView alignment within Ruler.
Reply #3 - Oct 21st, 2024 at 5:51am
Print Post  
This build lets you center the diagram within diagram view by setting HorizontalContentAlignment:

https://www.nuget.org/packages/MindFusion.Diagramming.Wpf/4.1.4-rc2

Code
Select All
<mindfusion:Ruler
    HorizontalAlignment="Stretch"
    VerticalAlignment="Stretch">

    <mindfusion:DiagramView x:Name="DiagramView"
        HorizontalContentAlignment="Center" />

</mindfusion:Ruler>
 

  
Back to top
 
IP Logged
 
nullable
Full Member
***
Offline


I Love MindFusion!

Posts: 118
Joined: Aug 25th, 2022
Re: Issue with DiagramView alignment within Ruler.
Reply #4 - Oct 22nd, 2024 at 11:51am
Print Post  
Yeah, it works as expected. Thank you!
  
Back to top
 
IP Logged
 
nullable
Full Member
***
Offline


I Love MindFusion!

Posts: 118
Joined: Aug 25th, 2022
Re: Issue with DiagramView alignment within Ruler.
Reply #5 - Nov 26th, 2024 at 10:18am
Print Post  
I would also like to ask if there is something we can do about the coordinates display. In the attached app I set width of 1000 units to diagram, but ruler display 600 by X-axis coordinate. Can I synchronize this ruler with the diagram?
  

MindfusionNewVersionIssues_001.zip ( 437 KB | 24 Downloads )
9NoUkUwT7V.png ( 63 KB | 13 Downloads )
9NoUkUwT7V.png
Back to top
 
IP Logged
 
Slavcho
YaBB Moderator
*****
Offline


tech.support

Posts: 3343
Joined: Oct 19th, 2005
Re: Issue with DiagramView alignment within Ruler.
Reply #6 - Nov 26th, 2024 at 1:10pm
Print Post  
Try changing ruler's Unit:

Code
Select All
<mindfusion:Ruler Unit="WpfPoint" ...
 



and I can't actually see this project changing diagram's width, so the diagram has default A4 size. You can change diagram's width by setting Bounds:

Code
Select All
diagram.Nodes.Add(imageNode);
diagram.Nodes.Last().Move(random.Next(Bottom, Top), random.Next(Bottom, Top));

Debug.WriteLine(diagram.Bounds);
diagram.Bounds = new Rect(Bottom, Bottom, Top, Top);
Debug.WriteLine(diagram.Bounds); 



Regards,
Slavcho
Mindfusion
  
Back to top
 
IP Logged
 
nullable
Full Member
***
Offline


I Love MindFusion!

Posts: 118
Joined: Aug 25th, 2022
Re: Issue with DiagramView alignment within Ruler.
Reply #7 - Nov 26th, 2024 at 1:50pm
Print Post  
That worked, thank you!
  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint