mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-01 15:08:11 +08:00
Fix box selection erroneously including zero-length handles; fix GRS failing on sharp points (#2550)
* Fixed box selection selecting zero length handles * Fix GRS for sharp points * Apply suggestions from code review --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
co-authored by
Keavon Chambers
parent
e759e62291
commit
550ffc3f7f
@@ -1444,7 +1444,14 @@ impl ShapeState {
|
|||||||
if select {
|
if select {
|
||||||
match selection_change {
|
match selection_change {
|
||||||
SelectionChange::Shrink => state.deselect_point(id),
|
SelectionChange::Shrink => state.deselect_point(id),
|
||||||
_ => state.select_point(id),
|
_ => {
|
||||||
|
// Select only the handles which are of nonzero length
|
||||||
|
if let Some(handle) = id.as_handle() {
|
||||||
|
if handle.length(&vector_data) > 0. {
|
||||||
|
state.select_point(id)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -403,9 +403,12 @@ impl MessageHandler<TransformLayerMessage, TransformData<'_>> for TransformLayer
|
|||||||
let handle1_length = handle1.length(&vector_data);
|
let handle1_length = handle1.length(&vector_data);
|
||||||
let handle2_length = handle2.length(&vector_data);
|
let handle2_length = handle2.length(&vector_data);
|
||||||
|
|
||||||
if (handle1_length == 0. && handle2_length == 0.) || (handle1_length == f64::MAX && handle2_length == f64::MAX) {
|
if (handle1_length == 0. && handle2_length == 0. && !using_select_tool) || (handle1_length == f64::MAX && handle2_length == f64::MAX && !using_select_tool) {
|
||||||
selected.original_transforms.clear();
|
// G should work for this point but not R and S
|
||||||
return;
|
if matches!(transform_type, TransformType::Rotate | TransformType::Scale) {
|
||||||
|
selected.original_transforms.clear();
|
||||||
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user