diff options
author | bptato <nincsnevem662@gmail.com> | 2022-12-16 15:36:46 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-12-16 15:37:13 +0100 |
commit | 6b9718de754fe10785094fc9f80c24f3db25d5a9 (patch) | |
tree | a1153f83e98903906f9d031800e3e2e953a6f318 /src/layout | |
parent | b2998ca90c0dd6eb7d6b2a1deb19645d7ceb459f (diff) | |
download | chawan-6b9718de754fe10785094fc9f80c24f3db25d5a9.tar.gz |
Remove obsolete buildInlineTableBox
Diffstat (limited to 'src/layout')
-rw-r--r-- | src/layout/engine.nim | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/layout/engine.nim b/src/layout/engine.nim index 77ac4183..e6e73899 100644 --- a/src/layout/engine.nim +++ b/src/layout/engine.nim @@ -576,33 +576,6 @@ proc buildInlineBlock(builder: BlockBoxBuilder, parent: InlineContext, parentWid result.width += result.innerbox.margin_left result.width += result.innerbox.margin_right -# Copy-pasted wholesale from above. TODO generalize this somehow -proc buildInlineTableBox(builder: TableBoxBuilder, parent: InlineContext, parentWidth: int, parentHeight = none(int)): InlineBlockBox = - result = newInlineBlock(parent.viewport, builder, parentWidth) - - result.innerbox.nested.add(buildTable(builder, result.innerbox)) - - let pwidth = builder.computed{"width"} - if pwidth.auto: - # shrink-to-fit - result.innerbox.width = min(parentWidth, result.innerbox.width) - else: - result.innerbox.width = pwidth.px(parent.viewport, parentWidth) - - # Apply the block box's properties to the atom itself. - result.width = result.innerbox.width - result.height = result.innerbox.height - - result.margin_top = result.innerbox.margin_top - result.margin_bottom = result.innerbox.margin_bottom - - result.baseline = result.innerbox.baseline - - # I don't like this, but it works... - result.offset.x = result.innerbox.margin_left - result.width += result.innerbox.margin_left - result.width += result.innerbox.margin_right - proc buildInline(viewport: Viewport, box: InlineBoxBuilder, parentWidth: int, parentHeight = none(int)) = assert box.ictx != nil if box.newline: |