fix(ui-egui): a click on the empty Layers panel space deselects every layer, as in Photoshop (#8100)

This commit is contained in:
Korg1ch
2026-10-21 05:28:31 +03:00
parent b097800e78
commit 18aa6a199b
+4
View File
@@ -2633,6 +2633,10 @@ fn layers(app: &mut PhotocraftApp, ui: &mut egui::Ui) {
if let Some(&(last, last_rect)) = drawn.last() {
let below = Rect::from_min_max(pos2(last_rect.left(), last_rect.bottom()), pos2(last_rect.right(), ui.clip_rect().bottom()));
layer_drop_zone(app, &ctx, ui, below, (last, last_rect), "below", &mut actions);
// A click on that empty space deselects every layer, as in Photoshop (#8100).
if below.height() > 0.0 && ui.interact(below, ui.id().with("layers-empty-space"), Sense::click()).clicked() && !selection.is_empty() {
actions.push(("select.deselectLayers".into(), json!({})));
}
}
// Tab / ⇧Tab in a rename: rename the layer below / above next, as in Photoshop. The
// Background isn't renamed in place (double-clicking it converts it), so it ends there.