Hold the guide-drag cursor only while the primary button is down

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Brandon Thomas
2026-10-29 21:39:56 -04:00
co-authored by Claude Opus 5.5
parent 30b64114c2
commit 794b7a29de
+4 -2
View File
@@ -744,8 +744,10 @@ pub fn show(app: &mut DesignApp, ui: &mut egui::Ui) {
None => c,
};
// A ruler guide being dragged keeps the cursor across it until it is dropped, over the
// canvas too (the tool's cursor took over as soon as the pointer left the ruler).
let c = match ui.data(|d| d.get_temp::<GuideDrag>(egui::Id::unique(GUIDE_DRAG))).map(|g| g.orientation) {
// canvas too (the tool's cursor took over as soon as the pointer left the ruler). Only
// while the button is down: a drag state left behind by a skipped release doesn't stick.
let dragging = ui.input(|i| i.pointer.primary_down());
let c = match ui.data(|d| d.get_temp::<GuideDrag>(egui::Id::unique(GUIDE_DRAG))).filter(|_| dragging).map(|g| g.orientation) {
Some(designcraft_doc::Orientation::Horizontal) => Cursor::ResizeV,
Some(designcraft_doc::Orientation::Vertical) => Cursor::ResizeH,
None => c,