Add auto-panning when pointer goes beyond viewport edge with Select tool (#1625)

* Add code to shift viewport if mouse is beyond edge

* Allow shifting viewport if mouse is stationary too

* Group all modifier keys into SelectToolPointerKeys

* Cleanup message ordering to remove shifting during resize

* Slow down shifting by half

* Clamp speed; code review cleanup

---------

Co-authored-by: 0hypercube <0hypercube@gmail.com>
Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Elbert Ronnie
2024-02-28 23:52:36 -08:00
committed by Keavon Chambers
co-authored by 0hypercube Keavon Chambers
parent 4405e01f55
commit 8e769e37f6
5 changed files with 154 additions and 20 deletions
+3
View File
@@ -18,6 +18,9 @@ pub const VIEWPORT_ROTATE_SNAP_INTERVAL: f64 = 15.;
pub const VIEWPORT_ZOOM_TO_FIT_PADDING_SCALE_FACTOR: f64 = 0.95;
pub const DRAG_BEYOND_VIEWPORT_MAX_OVEREXTENSION_PIXELS: f64 = 50.;
pub const DRAG_BEYOND_VIEWPORT_SPEED_FACTOR: f64 = 0.5;
// Snapping point
pub const SNAP_POINT_TOLERANCE: f64 = 5.;