fix(editor): color picker swallows cursor moves over its panel

apply_cursor_move only handled the picker while dragging; an open-but-idle
picker fell through to the canvas hover layer, so hovering the picker
bled selection/hover feedback onto the nodes behind it. Swallow moves
whose point is inside the picker panel (clear lower-overlay hover + return),
matching the design-md / modal overlay behaviour.
This commit is contained in:
Kayshen-X 2026-06-20 18:44:44 +08:00
parent bb03388dfa
commit 34dcd0547f

View file

@ -537,6 +537,18 @@ impl WidgetHostNative {
}
return true;
}
// Picker open but not dragging — it is a top-most overlay, so a move
// over its panel must be swallowed (canvas hover must not bleed
// through underneath it). Matches the design-md / modal behaviour.
let picker = op_editor_ui::widgets::color_picker::ColorPicker::for_state(
&self.editor_state,
state.clone(),
);
let panel = picker.rect(self.last_viewport_w, self.last_viewport_h);
if panel.contains(Point2D::new(x, y)) {
self.clear_lower_overlay_hover();
return true;
}
}
// Top-most floating panel drags own cursor movement.
if let Some(d) = self.design_md_drag {