mirror of
https://github.com/storytold/photocraft.git
synced 2026-12-02 06:20:48 +01:00
Start Type Mask text with the placeholder, as the Type tool does (#12072)
A click or a drag with the Horizontal Type Mask tool now starts with the same selected placeholder text as the Type tool, so typing replaces it and committing it untouched selects its outline. With "Fill new type layers with placeholder text" off, masks start empty, as type does. The Vertical Type Mask keeps starting empty: its placeholder is not measured yet.
This commit is contained in:
1 parent
331aa99d50
commit
76d055a7ee
1 file changed
+5
-3
@@ -317,9 +317,11 @@ pub fn pointer_up(app: &mut PhotocraftApp, start: [f64; 2], end: [f64; 2]) {
|
||||
// A click (not a drag) with the Type tool on a path: area type inside a closed path, type
|
||||
// on the path on its outline. The Type Mask tools ignore paths.
|
||||
let target = if !mask && !makes_box(app, start, end) { path_target(app, start[0], start[1]) } else { None };
|
||||
// Preferences ▸ Type: "Fill new type layers with placeholder text" (on by default). The Type
|
||||
// Mask tools start empty, as Photoshop's do.
|
||||
let text = if !mask && app.session.prefs().type_.fill_new_type_layers_with_placeholder { PLACEHOLDER } else { "" };
|
||||
// Preferences ▸ Type: "Fill new type layers with placeholder text" (on by default). The
|
||||
// Horizontal Type Mask gets the Type tool's placeholder, as Photoshop's does (#12072); the
|
||||
// vertical mask's placeholder is not measured yet, so it keeps starting empty.
|
||||
let placeholder = app.ui.tool != crate::state::Tool::VerticalTypeMask && app.session.prefs().type_.fill_new_type_layers_with_placeholder;
|
||||
let text = if placeholder { PLACEHOLDER } else { "" };
|
||||
let mut p = default_style_params(app);
|
||||
p["text"] = json!(text);
|
||||
p["orientation"] = json!(if app.ui.tool.is_vertical_type() { "vertical" } else { "horizontal" });
|
||||
|
||||
Reference in new issue
Block a user