This is a migrated thread and some comments may be shown as answers.

Resizing shapes

2 Answers 82 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
B
Top achievements
Rank 2
B asked on 30 Oct 2015, 09:33 AM

Hi,

Can you make resizing behave more like Visio? For example:

  • For some shapes, the corner's aspect ratio should be preserved (rounded rectangle, begin loop, card)
  • For all shapes, resizing from the corner should preserve the aspect ratio. For example, when resizing an octagon you usually want the aspect ratio to be preserved, so you resize from the corner. You can Always resize from the edge in the case where you don't want the aspect ratio preserved.

Regards,

Bayram

 

 

2 Answers, 1 is accepted

Sort by
0
Kiril Vandov
Telerik team
answered on 04 Nov 2015, 10:11 AM
Hello  Bayram,

We will need a little more time to process your request and will contact you once we have more information about your scenario.

Kind regards,
Kiril Vandov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Kiril Vandov
Telerik team
answered on 04 Nov 2015, 04:50 PM
Hello Bayram,

Please excuse us for the delayed response.
You can override the default resizing logic of the RadDiagram by overriding/extending its ResizingService. You can find information about the Services of the RadDiagram in this help article. By inheriting the default ResizingService and overriding its Resize method you can manipulate the new point for resizing and therefor keep the Ratio of an shape based on Attached property or simply keep the ratio of all shapes. I have prepared a sample project demonstrating the approach, please keep in mind that there might be some border cases that need to be polished.

As for your other question you about keeping the rounded corners ratio. The Shape is displaying its Geometry in a Path which Stretch property is set to Fill which makes the path to fill the entire Shape based on its size. The RadDiagram is not manipulating the Geometry when you resize the shape and that is why the rounding is lost. You could use the SizeChanged event of the RadDiagramShape and recalculate its geometry based on some custom logic. However such recalculation will be though to calculate.

I hope this information helps.

Kind regards,
Kiril Vandov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Diagram
Asked by
B
Top achievements
Rank 2
Answers by
Kiril Vandov
Telerik team
Share this question
or