fix(runtime): set Static yoga node to display:none in dynamic layout
Static content is rendered via paintIsolated (separate channel), but its yoga node was still participating in the dynamic frame layout calculation, adding blank lines equal to the Static content height between the last Static item and the dynamic content below. Setting display:none on the Static yoga node removes it from the dynamic layout. paintIsolated is unaffected — it reparents children into a temporary yoga tree.
This commit is contained in:
@@ -43,6 +43,11 @@ function hasYoga(node: TuiNode): node is YogaCarrier {
|
||||
|
||||
export function attachYoga(node: YogaCarrier): void {
|
||||
node.yoga = createYogaNode();
|
||||
// Static nodes are painted via a separate channel (paintIsolated), so they
|
||||
// must not occupy space in the dynamic frame's yoga layout.
|
||||
if (node.type === "static") {
|
||||
(node.yoga as YogaNode).setDisplay(Yoga.DISPLAY_NONE);
|
||||
}
|
||||
}
|
||||
|
||||
export function detachYoga(node: YogaCarrier): void {
|
||||
|
||||
Reference in New Issue
Block a user