diff --git a/src/ui/tools/booleans-tool.cpp b/src/ui/tools/booleans-tool.cpp index 8ae1470abc433c492acb8b5729e9bdf2c417516e..9453100aa2cf25103148181c8a3d10d3794a69fc 100644 --- a/src/ui/tools/booleans-tool.cpp +++ b/src/ui/tools/booleans-tool.cpp @@ -177,6 +177,10 @@ bool InteractiveBooleansTool::root_handler(CanvasEvent const &event) set_cursor(add ? "cursor-union.svg" : "cursor-delete.svg"); update_status(); + if (last_cursor_position) { + boolean_builder->highlight(*last_cursor_position, add); + } + return ToolBase::root_handler(event); } @@ -222,6 +226,7 @@ bool InteractiveBooleansTool::event_button_press_handler(ButtonPressEvent const bool InteractiveBooleansTool::event_motion_handler(MotionEvent const &event) { + last_cursor_position = event.pos; bool add = should_add(event.modifiers); if (event.modifiers & GDK_BUTTON1_MASK) { @@ -230,9 +235,9 @@ bool InteractiveBooleansTool::event_motion_handler(MotionEvent const &event) } else { return boolean_builder->task_select(event.pos, add); } - } else { - return boolean_builder->highlight(event.pos, add); } + + return false; } bool InteractiveBooleansTool::event_button_release_handler(ButtonReleaseEvent const &event) diff --git a/src/ui/tools/booleans-tool.h b/src/ui/tools/booleans-tool.h index a1092ffa6ac1b84c6a0ec843960bed417b4532ac..fc9da3ef8ce8cc40d1be3731fc73b27c430d81ea 100644 --- a/src/ui/tools/booleans-tool.h +++ b/src/ui/tools/booleans-tool.h @@ -63,6 +63,7 @@ private: sigc::scoped_connection _sel_changed; bool to_commit = false; + std::optional last_cursor_position; }; } // namespace Tools