Resizing shapes

3 posts, 0 answers
  1. B
    B avatar
    74 posts
    Member since:
    Jul 2011

    Posted 30 Oct 2015 Link to this post

    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. Kiril Vandov
    Admin
    Kiril Vandov avatar
    324 posts

    Posted 04 Nov 2015 Link to this post

    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
  3. DevCraft banner
  4. Kiril Vandov
    Admin
    Kiril Vandov avatar
    324 posts

    Posted 04 Nov 2015 Link to this post

    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
Back to Top