mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
Remove tool: a press on a type layer does nothing, with no rasterize prompt (#12553)
The reference's Remove tool ignores a type layer: no prompt, no stroke overlay and no history state, and the layer stays type. Brush, Eraser and the other pixel tools keep the prompt there, and the Remove tool still asks on shape, Smart Object and fill layers.
This commit is contained in:
1 parent
2be87e4463
commit
d9858a7110
1 file changed
+6
-1
@@ -102,12 +102,17 @@ pub fn needed(app: &PhotocraftApp) -> Option<(Kind, photocraft_doc::LayerId)> {
|
||||
}
|
||||
|
||||
/// A tool's pointer press: when it would paint a layer that must be rasterized first, park it
|
||||
/// behind the prompt and return true (the tool must not see the press).
|
||||
/// behind the prompt, or drop it (the Remove tool on a type layer), and return true (the tool
|
||||
/// must not see the press).
|
||||
pub fn intercept(app: &mut PhotocraftApp, tool: Tool, x: f64, y: f64, pressure: f32) -> bool {
|
||||
if !paints_pixels(app, tool) {
|
||||
return false;
|
||||
}
|
||||
let Some((kind, layer)) = needed(app) else { return false };
|
||||
// The reference's Remove tool ignores a type layer: no prompt and no stroke (#12553).
|
||||
if tool == Tool::Remove && kind == Kind::Type {
|
||||
return true;
|
||||
}
|
||||
if !app.ui.dialogs.iter().any(|d| owns(&d.fields)) {
|
||||
open(app, kind, layer, tool, [x, y, f64::from(pressure)]);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user