mirror of
https://github.com/storytold/designcraft.git
synced 2026-10-30 21:26:48 -06:00
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:
co-authored by
Claude Opus 5.5
parent
30b64114c2
commit
794b7a29de
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user