mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-03 06:31:42 +01:00
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.
This commit is contained in:
1 parent
3c23fb293a
commit
5e7bf886db
2 files changed
+4
-1
No files matched your search
@@ -196,6 +196,9 @@ fn with_resize<R>(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 {
|
||||
|
||||
@@ -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()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user