Unplanned
Last Updated: 06 May 2021 11:36 by ADMIN
Richard
Created on: 22 Apr 2021 13:16
Category: ImageEditor
Type: Feature Request
1
ImageEditor: Shape Tool - Line Shape lock ratio should constrain horizontally and vertically...

In the Shape Tool - Line Shape -> lock ratio, this currently constrains the lines to be diagonal.

IMHO it'd be a more common use case that users would want to constrain a line to be horizontal or vertical.

 

I would suggest changing the default behaviour of the ratio lock for line shapes to be horizontal/vertical and not diagonal.

You could leave the Ctrl key modifier to still constrain diagonally, but add a Shift key modifier so that holding shift constrains the line vertically / horizontally (this would coincide with Photoshop behaviour).

 

I know it's not a great idea to change behaviour on published code, so could consider adding a LockRatioMode property to the shape tool that defaults to Diagonal, and allow coders to set it to HorizontalVertical to implement the new behaviour.

 

Thanks

3 comments
ADMIN
Martin Ivanov
Posted on: 06 May 2021 11:36

Hello Richard,

Your thoughts make sense. Indeed, the "lock ratio" option is enabled for all types of shapes even if the visualization is not very straightforward. The feature uses a rectangle bounds based resizing for all the shapes when locking the ratio. As Dido mentioned, this is why the line is drawing in the current manner. It is probable that the feature is used by someone, so we cannot just introduce a breaking change, but we agree that the feature you are asking for is meaningful. This is why we approved this feature request. 

In the meantime, you can achieve the desired effect by implementing a custom ShapeTool and override its drawing methods. This will allow you to replace the default geometry of the line in case line is selected and Shift is pressed. I've attached a small example showing this approach. I hope it helps.

Regards,
Martin Ivanov
Progress Telerik

Тhe web is about to get a bit better! 

The Progress Hack-For-Good Challenge has started. Learn how to enter and make the web a worthier place: https://progress-worthyweb.devpost.com.

Richard
Posted on: 29 Apr 2021 14:01

Hi Dilyan,

 

I didn't think of the case where you are scaling a rectangle or circle, of course they must scale x & y!

 

But for the line it doesn't really make sense to constrain it diagonally.

 

Personally I would design it so that the Lock Ratio checkbox was disabled (greyed out) if the line shape was selected because a line doesn't really have an aspect ratio. And add a shift key modifier so that the line can be constrained vertically or horizontally.

 

Thanks for the extra information, I'm sure my users will ask why the line can be locked to be diagonal, and now I can explain the current rationale.

ADMIN
Dilyan Traykov
Posted on: 29 Apr 2021 11:59

Hello Richard,

When the Lock Ratio functionality is enabled, it is expected for the line to be drawn diagonally as, otherwise, the Width and Height properties of the underlying shape will not be equal.

I can, however, agree that it would be useful to be able to constrain the lines to be only vertical, horizontal or diagonal by pressing the Shift or Control key as this is done in Microsoft Paint, for example. This would only make sense when the lock ratio feature is disabled, though.

Please let me know if you agree with this opinion.

Regards,
Dilyan Traykov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.