diff options
author | Rodrigo Arias Mallo <rodarima@gmail.com> | 2023-12-31 20:15:36 +0100 |
---|---|---|
committer | Rodrigo Arias Mallo <rodarima@gmail.com> | 2024-01-08 22:16:27 +0100 |
commit | fb23343442bc3c6d85584edfc8cda3dd36a81182 (patch) | |
tree | 7876932f824f6d2b50693a525b4ee9dd3f60222a /test/html/render/max-width-html.html | |
parent | 24bcd67df29a5418d05600b038a9283a00e555d2 (diff) |
Constraint width in calcFinalWitdh()
Then min-width or max-width is given in the CSS style for the current
widget, the returned width should be clamped by those values.
The condition *finalValue != 1 was used to clamp with min-width, but it
doesn't capture the situation when the finalValue was not yet set.
Similarly, for the max-width, the finalWidth was only set when
*finalValue == -1, which prevented the clamping when the width is set.
The change always perform the clamp when finalWidth is not set or when
the value exceeds the min or max value. When both min-width and
max-width are given but width is -1, the resulting width is the
min-witdh, as the max-width clamp rule won't trigger after setting the
*finalValue to the min-witdh.
Diffstat (limited to 'test/html/render/max-width-html.html')
0 files changed, 0 insertions, 0 deletions