Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Updating width and height of an ellipse should update rx and ry and vice versa #10179

Open
4 tasks done
houssameddine-h opened this issue Sep 25, 2024 · 3 comments
Open
4 tasks done

Comments

@houssameddine-h
Copy link

CheckList

  • I agree to follow this project's Code of Conduct
  • I have read and followed the Contributing Guide
  • I have searched and referenced existing issues, feature requests and discussions
  • I am filing a FEATURE request.

Description

Hi all,

The way ellipses are implemented for now is: if you update rx or ry the width and height get updated accordingly, but not the other way around (if you update the width or height the rx and ry don't get updated) which is more intuitive to actually do in my opinion.
The decision for this implementation was made here: #1062

This is a real problem, because when you try to resize an ellipse using the UI controls, it actually changes the width and height of the ellipse, which has no effect on the shape itself, but only updates the "container" of the shape.

It's easy enough to fix this in my own project, but I feel like everybody will have to do the same, since no one wants to resize a shape using the controls and having only the container changing.

The same behavior is implemented in circles, so we might fix that as well.

This is what you get when you try to resize an ellipse using the UI controls:

Screenshot 2024-09-25 at 23-33-37 React App

Current State

As a workaround for now, we can update these properties accordingly by listening to the relevant events.

Additional Context

No response

@asturur
Copy link
Member

asturur commented Sep 26, 2024

You can also just make some controls that update rx and ry instead of width and height.
The resize controls, the one that changes the width, was designed only for the textbox.
In general width/height drive changes in rect and textbox but are just a consequences of other properties in all other shapes.

@houssameddine-h
Copy link
Author

I see your point @asturur, but if those controls were designed specifically for textbox, then why not designing specific control behavior for other shapes as well?
I'm not sure of the amount of work that would take, but in the case of ellipses and circles it's not a lot.

I know that we should design the library to be generic, but since we already implemented different shapes, we should tweak the default controls to be specific to each shape.

@houssameddine-h
Copy link
Author

Also I'm not sure how to change the default behavior of the controls without having to redefine them all.

My initial approach was to listen for the object:scaling event and update the object properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants