diff --git a/crates/rnote-engine/src/meson.build b/crates/rnote-engine/src/meson.build index 814db7e55d..1885a1f681 100644 --- a/crates/rnote-engine/src/meson.build +++ b/crates/rnote-engine/src/meson.build @@ -35,6 +35,9 @@ rnote_engine_sources = files( 'pens/shaper.rs', 'pens/shortcuts.rs', 'pens/tools/mod.rs', + 'pens/tools/offsetcamera.rs', + 'pens/tools/verticalspace.rs', + 'pens/tools/zoom.rs', 'pens/typewriter/mod.rs', 'pens/typewriter/penevents.rs', 'store/chrono_comp.rs', diff --git a/crates/rnote-engine/src/pens/tools/offsetcamera.rs b/crates/rnote-engine/src/pens/tools/offsetcamera.rs index 2dd1bebb9e..02ae0712ed 100644 --- a/crates/rnote-engine/src/pens/tools/offsetcamera.rs +++ b/crates/rnote-engine/src/pens/tools/offsetcamera.rs @@ -149,6 +149,10 @@ impl OffsetCameraTool { impl DrawableOnDoc for OffsetCameraTool { fn bounds_on_doc(&self, engine_view: &EngineView) -> Option { + if matches!(self.state, ToolsState::Idle) { + return None; + } + Some(Aabb::from_half_extents( self.start.into(), ((Self::CURSOR_SIZE + na::Vector2::repeat(Self::CURSOR_STROKE_WIDTH)) * 0.5) diff --git a/crates/rnote-engine/src/pens/tools/verticalspace.rs b/crates/rnote-engine/src/pens/tools/verticalspace.rs index 65958484d4..0eb5d2d2e8 100644 --- a/crates/rnote-engine/src/pens/tools/verticalspace.rs +++ b/crates/rnote-engine/src/pens/tools/verticalspace.rs @@ -219,6 +219,10 @@ impl VerticalSpaceTool { impl DrawableOnDoc for VerticalSpaceTool { fn bounds_on_doc(&self, engine_view: &EngineView) -> Option { + if matches!(self.state, ToolsState::Idle) { + return None; + } + let viewport = engine_view.camera.viewport(); let x = viewport.mins[0]; diff --git a/crates/rnote-engine/src/pens/tools/zoom.rs b/crates/rnote-engine/src/pens/tools/zoom.rs index 01d4865ae7..7f3adda6d7 100644 --- a/crates/rnote-engine/src/pens/tools/zoom.rs +++ b/crates/rnote-engine/src/pens/tools/zoom.rs @@ -178,6 +178,10 @@ impl ZoomTool { impl DrawableOnDoc for ZoomTool { fn bounds_on_doc(&self, engine_view: &EngineView) -> Option { + if matches!(self.state, ToolsState::Idle) { + return None; + } + let start_circle_center = engine_view .camera .transform()