mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-21 20:48:11 +08:00
Code cleanup after migrating node graph interaction to the backend (#1790)
* Cleanup transforms and click targets * Improve click target caching * Fix click target bugs * Add auto panning * update_modified_click_targets * Code review --------- Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
co-authored by
Keavon Chambers
parent
6fd5b76430
commit
84ac2e274e
@@ -61,7 +61,7 @@ impl SnapConstraint {
|
||||
}
|
||||
}
|
||||
pub fn snap_tolerance(document: &DocumentMessageHandler) -> f64 {
|
||||
document.snapping_state.tolerance / document.navigation.zoom
|
||||
document.snapping_state.tolerance / document.document_ptz.zoom
|
||||
}
|
||||
|
||||
fn compare_points(a: &&SnappedPoint, b: &&SnappedPoint) -> Ordering {
|
||||
|
||||
@@ -21,7 +21,7 @@ impl GridSnapper {
|
||||
let document = snap_data.document;
|
||||
let mut lines = Vec::new();
|
||||
|
||||
let Some(spacing) = GridSnapping::compute_rectangle_spacing(spacing, &document.navigation) else {
|
||||
let Some(spacing) = GridSnapping::compute_rectangle_spacing(spacing, &document.document_ptz) else {
|
||||
return lines;
|
||||
};
|
||||
let origin = document.snapping_state.grid.origin;
|
||||
@@ -47,7 +47,7 @@ impl GridSnapper {
|
||||
let tan_a = angle_a.to_radians().tan();
|
||||
let tan_b = angle_b.to_radians().tan();
|
||||
let spacing = DVec2::new(y_axis_spacing / (tan_a + tan_b), y_axis_spacing);
|
||||
let Some(spacing_multiplier) = GridSnapping::compute_isometric_multiplier(y_axis_spacing, tan_a + tan_b, &document.navigation) else {
|
||||
let Some(spacing_multiplier) = GridSnapping::compute_isometric_multiplier(y_axis_spacing, tan_a + tan_b, &document.document_ptz) else {
|
||||
return lines;
|
||||
};
|
||||
let spacing = spacing * spacing_multiplier;
|
||||
|
||||
Reference in New Issue
Block a user