-
-
Notifications
You must be signed in to change notification settings - Fork 498
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
Add Path tool support for G/R/S rotation and scaling with a single selected handle #2180
base: master
Are you sure you want to change the base?
Add Path tool support for G/R/S rotation and scaling with a single selected handle #2180
Conversation
!build |
|
6c0881b
to
812bdec
Compare
812bdec
to
ab55281
Compare
!build |
|
ab55281
to
ba3cc5a
Compare
!build |
|
if let Some(point) = selected_points.first() { | ||
match point { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can combine this if let
and match
, I believe.
if let Some(point) = selected_points.first() { | ||
match point { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too.
match point { | ||
ManipulatorPointId::Anchor(_) => { | ||
if let Some([handle1, handle2]) = point.get_handle_pair(&vector_data) { | ||
if (handle1.get_handle_length(&vector_data) == 0.0 && handle2.get_handle_length(&vector_data) == 0.0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid using the style 0.0
and use the 0.
style instead with decimals.
return; | ||
} | ||
|
||
if selected_points.len() == 1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please find opportunities to avoid so much nesting here, like early returning to flatten this out. I suppose that might mean needing to return selected.original_transforms.clear();
in a number of places to keep parity with the current last line of this block.
return; | ||
} | ||
|
||
if selected_points.len() == 1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too much nesting here too, please find ways to early return and combine if let
s together.
ba3cc5a
to
cc033f4
Compare
This pr implements some parts of #1870 and also some minor improvements
Minor improvements as discussed -