From 5e7bf886db6987a7434dd682d68c2a27f3ce4f70 Mon Sep 17 00:00:00 2001 From: Josias Eli Rodriguez <339499413+chamber074@users.noreply.github.com> Date: Wed, 25 Nov 2026 10:55:08 -0600 Subject: [PATCH] Paint Bucket: grey Clear with Behind on the Background, and clear Behind off at the click mode_entries only disabled the Behind entry; the bucket's Clear stayed a wheel stop on the Background. Both special modes now take the enabled flag (stamps have no Clear in their lists, so they are unaffected). The bucket's press returns before the stroke path's clear-off call, so click_tool clears Behind off on the Background itself. --- crates/ui-egui/src/canvas/paint_tool.rs | 3 +++ crates/ui-egui/src/panels/options_bar/fill.rs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/canvas/paint_tool.rs b/crates/ui-egui/src/canvas/paint_tool.rs index 31b4cdf90ab..18a0ffa8daf 100644 --- a/crates/ui-egui/src/canvas/paint_tool.rs +++ b/crates/ui-egui/src/canvas/paint_tool.rs @@ -196,6 +196,9 @@ fn with_resize(app: &mut PhotocraftApp, f: impl FnOnce(&mut crate::brush_resi fn click_tool(app: &mut PhotocraftApp, tool: Tool, at: [f64; 2]) -> bool { match tool { Tool::PaintBucket => { + // The press path returns before the stroke paths clear-off call, so the buckets + // own clear-off on the Background (#12531) happens here, before the options are read. + clear_off_on_background(app, Tool::PaintBucket); let o = app.ui.tool_options.clone(); let contents = if o.bucket_fill_pattern { "pattern" } else { "foreground" }; let mode = if o.bucket_clear { diff --git a/crates/ui-egui/src/panels/options_bar/fill.rs b/crates/ui-egui/src/panels/options_bar/fill.rs index 2c67a36f185..0aa6cc29b08 100644 --- a/crates/ui-egui/src/panels/options_bar/fill.rs +++ b/crates/ui-egui/src/panels/options_bar/fill.rs @@ -56,7 +56,7 @@ pub(crate) fn mode_entries(tool: Tool, behind_enabled: bool, threshold: bool) -> key => label_of(key).into(), }) .into_iter() - .map(|entry| if entry.value() == Some(&PaintMode::Behind) { entry.enabled(behind_enabled) } else { entry }) + .map(|entry| if matches!(entry.value(), Some(&PaintMode::Behind) | Some(&PaintMode::Clear)) { entry.enabled(behind_enabled) } else { entry }) .collect() }) }