diff options
author | bptato <nincsnevem662@gmail.com> | 2024-10-05 19:46:20 +0200 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2024-10-05 20:11:09 +0200 |
commit | 954cef984a70c6e81ec9921a7a9c6982b9ff66e0 (patch) | |
tree | cb0baac7aa844ef5a38a6c730cd5d053bb77db9a /src | |
parent | 1f6314978683e71abd09b8d028934705119f9633 (diff) | |
download | chawan-954cef984a70c6e81ec9921a7a9c6982b9ff66e0.tar.gz |
layout: fix floats overriding margin/padding
Diffstat (limited to 'src')
-rw-r--r-- | src/layout/engine.nim | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/layout/engine.nim b/src/layout/engine.nim index 89cfeab3..2fef28de 100644 --- a/src/layout/engine.nim +++ b/src/layout/engine.nim @@ -568,8 +568,9 @@ proc initLine(ictx: var InlineContext) = left = ex.offset.x + ex.size.w else: right = ex.offset.x - ictx.lbstate.size.w = left - bfcOffset.x - ictx.lbstate.availableWidth = right - bfcOffset.x + ictx.lbstate.size.w = max(left - bfcOffset.x, 0) + ictx.lbstate.availableWidth = min(right - bfcOffset.x, + ictx.lbstate.availableWidth) proc finishLine(ictx: var InlineContext; state: var InlineState; wrap: bool; force = false) = |