Massively reorganize and clean up the whole Rust codebase (#478)

* Massively reorganize and clean up the whole Rust codebase

* Additional changes during code review
This commit is contained in:
Keavon Chambers
2022-01-14 14:58:08 -08:00
parent f63424b676
commit 40d5960571
85 changed files with 2515 additions and 2189 deletions
+40
View File
@@ -0,0 +1,40 @@
use crate::input::keyboard::Key;
use crate::message_prelude::*;
use glam::DVec2;
use serde::{Deserialize, Serialize};
#[remain::sorted]
#[impl_message(Message, DocumentMessage, Movement)]
#[derive(PartialEq, Clone, Debug, Serialize, Deserialize)]
pub enum MovementMessage {
DecreaseCanvasZoom {
center_on_mouse: bool,
},
FitViewportToBounds {
bounds: [DVec2; 2],
padding_scale_factor: Option<f32>,
prevent_zoom_past_100: bool,
},
IncreaseCanvasZoom {
center_on_mouse: bool,
},
MouseMove {
snap_angle: Key,
wait_for_snap_angle_release: bool,
snap_zoom: Key,
zoom_from_viewport: Option<DVec2>,
},
RotateCanvasBegin,
SetCanvasRotation(f64),
SetCanvasZoom(f64),
TransformCanvasEnd,
TranslateCanvas(DVec2),
TranslateCanvasBegin,
TranslateCanvasByViewportFraction(DVec2),
WheelCanvasTranslate {
use_y_as_x: bool,
},
WheelCanvasZoom,
ZoomCanvasBegin,
}