Snapping system improvements and refactor (#621)

* Snap to points and refactor

* Improve dot position on bounds

* Add snap matrix

* Cleanup

* Code review

* Half axis fade rather than increase it

* Fix fmt

* Hide snap to point overlay when active

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
0HyperCube
2022-05-08 20:13:57 -07:00
committed by Keavon Chambers
co-authored by Keavon Chambers
parent f177f63217
commit 79d40fa451
14 changed files with 303 additions and 183 deletions
+11 -3
View File
@@ -15,9 +15,17 @@ pub const VIEWPORT_SCROLL_RATE: f64 = 0.6;
pub const VIEWPORT_ROTATE_SNAP_INTERVAL: f64 = 15.;
pub const SNAP_TOLERANCE: f64 = 3.;
pub const SNAP_OVERLAY_FADE_DISTANCE: f64 = 20.;
pub const SNAP_OVERLAY_UNSNAPPED_OPACITY: f64 = 0.4;
// Snapping axis
pub const SNAP_AXIS_TOLERANCE: f64 = 3.;
pub const SNAP_AXIS_OVERLAY_FADE_DISTANCE: f64 = 15.;
pub const SNAP_AXIS_UNSNAPPED_OPACITY: f64 = 0.4;
// Snapping point
pub const SNAP_POINT_OVERLAY_FADE_NEAR: f64 = 20.;
pub const SNAP_POINT_OVERLAY_FADE_FAR: f64 = 40.;
pub const SNAP_POINT_UNSNAPPED_OPACITY: f64 = 0.4;
pub const SNAP_POINT_TOLERANCE: f64 = 5.;
pub const SNAP_POINT_SIZE: f64 = 5.;
pub const DRAG_THRESHOLD: f64 = 1.;