mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-22 12:58:12 +08:00
Improve snapping performance (#3067)
* Use lyon_geom for intersection calculation of bezier segments * Implement approximate nearest point calculation and loosen bounding boxes * Add algorithm explanation * Update editor/src/messages/tool/common_functionality/snapping/layer_snapper.rs Co-authored-by: Keavon Chambers <keavon@keavon.com> --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
co-authored by
Keavon Chambers
parent
b44a4fba1e
commit
7c30f6168b
@@ -332,7 +332,8 @@ impl SnapManager {
|
||||
}
|
||||
return;
|
||||
}
|
||||
let Some(bounds) = document.metadata().bounding_box_with_transform(layer, DAffine2::IDENTITY) else {
|
||||
// We use a loose bounding box here since these are potential candidates which will be filtered later anyway
|
||||
let Some(bounds) = document.metadata().loose_bounding_box_with_transform(layer, DAffine2::IDENTITY) else {
|
||||
return;
|
||||
};
|
||||
let layer_bounds = document.metadata().transform_to_document(layer) * Quad::from_box(bounds);
|
||||
|
||||
Reference in New Issue
Block a user