The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
After changing diagram magnification property diagram orogin is the same as it was before. So, if user click zoom in button several times, diagram view moves to the left top corner of the diagram.
But I want to keep the view centered on the same diagram poin as it was before.
There are several solutions published on this forum how to center to the selected node, but if nothing is selected things seems to be more compolicated.
MWMelba Winshia Syncfusion Team April 7, 2010 01:07 PM UTC
Hi Witold,
Thank you for your interest in Syncfusion Products.
You can use the following code to display the view to the center of the diagram control. [c#] float locationX = (diagram1.Width - diagram1.View.Width) / 2; float locationY = (diagram1.Height - diagram1.View.Height) / 2; this.diagram1.View.Origin = new PointF(-locationX, -locationY);
It seems that Diagram.View.Height and Diagram.View.Width should change values after zooming in or out, but they dont. Diagram.View.Origin is the same all the time, despite visible area became smaller after zooming. Thus, after several zoom in iterations visible area moves to the left up corner of the diagram.
MWMelba Winshia Syncfusion Team April 13, 2010 12:48 PM UTC
Hi Witold,
Currently it is not possible to keep the view centered while zooming if nothing is selected. We tried for a workaround to solve this issue, but it seems to be more complicated and we are not able to achieve the accurate solution. So this has been confirmed as a Feature Request. We will implement this feature in our forthcoming new version releases or service pack releases. We usually have an interval of at least three months between releases. The feature implementation would also greatly depend on the factors such as product design, code compatibility and complexity. We will get back to you once the feature is implemented.