From d890b19ece7958d7ead72ae3ea2aea0ac0b7858a Mon Sep 17 00:00:00 2001 From: hnoerenberg Date: Fri, 20 Nov 2026 07:06:05 +0100 Subject: [PATCH] fix(type): keep a non-finite layer size out of the mask's create params `mask_style_from_active_layer` built the size with `json!` and only then asked `finite_style_value` about it. `json!` turns a non-finite f32 into `null` and `finite_style_value` accepts `null`, so `type.create` received `"size": null`, its `check_size_tracking` refused the whole parameter set, and the `if let Ok(v)` in `create_text` passed the error over: a Horizontal Type Mask click over a document whose active text layer carries a NaN or an infinite size did nothing at all. Gate the f32 product with `is_finite()` and only then make it JSON, so such a layer keeps the tool's own size and the mask still starts. Pinned by `a_non_finite_layer_size_keeps_the_tool_size`, red before this commit ("a new mask session at (60.0, 300.0)"). --- .../ui-egui/src/tools/type_tool/defaults.rs | 11 +++---- .../mask_active_layer_style_tests.rs | 29 +++++++++++++++++++ 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/crates/ui-egui/src/tools/type_tool/defaults.rs b/crates/ui-egui/src/tools/type_tool/defaults.rs index 9fb604ce6d3..17e6e452925 100644 --- a/crates/ui-egui/src/tools/type_tool/defaults.rs +++ b/crates/ui-egui/src/tools/type_tool/defaults.rs @@ -117,11 +117,12 @@ pub(super) fn mask_style_from_active_layer(app: &PhotocraftApp) -> Option