aboutsummaryrefslogtreecommitdiffstats
path: root/src/layout
diff options
context:
space:
mode:
Diffstat (limited to 'src/layout')
-rw-r--r--src/layout/engine.nim7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/layout/engine.nim b/src/layout/engine.nim
index 0a89c338..7b56d00b 100644
--- a/src/layout/engine.nim
+++ b/src/layout/engine.nim
@@ -466,9 +466,12 @@ proc buildInlineBlock(builder: InlineBlockBoxBuilder, parent: InlineContext, par
let pwidth = builder.computed{"width"}
if pwidth.auto:
# Half-baked shrink-to-fit
- result.bctx.width = min(max(result.bctx.width, parent.maxwidth), preferred.compwidth)
+ # Currently the misery that is determining content width is deferred to the
+ # inline layouting algorithm, which doesn't work that great but that's what
+ # we have.
+ result.bctx.width = min(parentWidth, result.bctx.width)
else:
- result.bctx.width = preferred.compwidth
+ result.bctx.width = pwidth.px(parent.viewport, parentWidth)
# Apply the block box's properties to the atom itself.
result.width = result.bctx.width