Skip to content

Commit 355bfd9

Browse files
fix: ensured that the text changes truly apply.
1 parent 448f925 commit 355bfd9

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

ui/panels/node_panel.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -794,12 +794,7 @@ def pick_color():
794794
return btn
795795

796796
# 4. NUMERIC
797-
is_numeric = TypeSafeParser.is_numeric_param(key) or annotation in (float, int)
798-
# EXCEPTION: 'text' and 'tex_strings' must ALWAYS be treated as strings, never numeric
799-
if key in ("text", "tex_strings"):
800-
is_numeric = False
801-
802-
if is_numeric:
797+
if TypeSafeParser.is_numeric_param(key) or annotation in (float, int):
803798
# ... (Keep existing numeric logic) ...
804799
if annotation is float or isinstance(value, float):
805800
sb = QDoubleSpinBox()

utils/helpers.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,14 @@ def is_asset_param(param_name: str) -> bool:
189189
def is_numeric_param(param_name: str) -> bool:
190190
if TypeSafeParser.is_asset_param(param_name):
191191
return False
192-
return any(kw in param_name.lower() for kw in TypeSafeParser.NUMERIC_KEYWORDS)
192+
193+
name_lower = param_name.lower()
194+
# EXCEPTION: 'text' and 'tex' parameters must never be treated as numeric
195+
# even if they contain 'x' or other keywords.
196+
if name_lower in ("text", "tex_strings", "tex"):
197+
return False
198+
199+
return any(kw in name_lower for kw in TypeSafeParser.NUMERIC_KEYWORDS)
193200

194201
@staticmethod
195202
def is_color_param(param_name: str) -> bool:

0 commit comments

Comments
 (0)