From e84a59aeff16877170077298f7b6c99babd19be9 Mon Sep 17 00:00:00 2001 From: Orkuncakilkaya Date: Tue, 29 Sep 2026 20:17:39 +0300 Subject: [PATCH] ludic.ui: a pooled node's reset lets go of its wrapped lines instead of clearing them - they are the memo's list (ly_wrap), shared by every node with that text, so a text that wraps vanished from the third frame on, in the game as in ui-preview; smoke.txt holds four frames of it Co-Authored-By: Claude Opus 5.5 --- packages/ludic.ui/node.ludic | 2 +- packages/ludic.ui/pool_reset_more.ludic | 2 +- tools/ui-preview/smoke.txt | 26 +++++++++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/packages/ludic.ui/node.ludic b/packages/ludic.ui/node.ludic index 6bbae5c0..30c56546 100644 --- a/packages/ludic.ui/node.ludic +++ b/packages/ludic.ui/node.ludic @@ -55,7 +55,7 @@ export property UiNode { z: int = 0 nowrap: bool = false # white-space: nowrap ellipsis: bool = false # text-overflow: ellipsis - lines: []string = null # a wrapped text's lines + lines: []string = null # a wrapped text's lines: the memo's (ly_wrap), not the node's none: Val = Value.null() # what ui_attr answers for an attribute it lacks: made with the node, read only var_names: []string = null # its custom properties (--name), which its descendants inherit var_vals: []string = null diff --git a/packages/ludic.ui/pool_reset_more.ludic b/packages/ludic.ui/pool_reset_more.ludic index 2d94469c..d42a7501 100644 --- a/packages/ludic.ui/pool_reset_more.ludic +++ b/packages/ludic.ui/pool_reset_more.ludic @@ -2,7 +2,7 @@ function nd_reset_b(n: UiNode) -> void { n.nowrap = false n.ellipsis = false - if n.lines != null { List.clear(n.lines) } + n.lines = null # the memo's list (ly_wrap), shared by every node with that text: never cleared if n.var_names != null { List.clear(n.var_names) } if n.var_vals != null { List.clear(n.var_vals) } n.fg = -1 diff --git a/tools/ui-preview/smoke.txt b/tools/ui-preview/smoke.txt index 972d912c..42a940e6 100644 --- a/tools/ui-preview/smoke.txt +++ b/tools/ui-preview/smoke.txt @@ -142,6 +142,32 @@ < 0 0 1 1 #ffffff 1 <= ok +# wrapped text stays drawn: a pooled node's reset once emptied the memo's shared lines, so a text +# that wraps vanished from the third frame on (two generations a screen) +> load "Wrap" "

Seesaibling aus dem Nordbecken

" ".c { width: 120px }" +<= ok + +> show "Wrap" +<= ok + +> frame 0 +< "Seesaibling aus" +< "dem Nordbecken" +<= ok + +> frame 1 +< "Seesaibling aus" +<= ok + +> frame 2 +< "Seesaibling aus" +< "dem Nordbecken" +<= ok + +> frame 3 +< "dem Nordbecken" +<= ok + > frobnicate <= fail "unknown request frobnicate"