core icon indicating copy to clipboard operation
core copied to clipboard

Parent-based sizing (Pw and Ph) can be unstable

Open kkoreilly opened this issue 7 months ago • 1 comments

Describe the bug

When specifying sizing in terms of Pw or Ph (especially Pw), the size of the widget you are styling can often affect the size of the parent, leading to recursion or instability.

How to reproduce

See #1516 for an example. This also can happen with image sizing in htmlcore. More generally, having Pw and Ph correspond to visible parent width and height would potentially prevent this problem. See also #1518 for another case where visible parent size should be used.

Example code


Relevant output


Platform

macOS

kkoreilly avatar May 05 '25 21:05 kkoreilly

The key logic here is to ignore any Pw, Ph settings in the first passes, and only apply them in SizeFinal. Similar to Grow factors basically.

rcoreilly avatar May 29 '25 21:05 rcoreilly