diff options
author | bptato <nincsnevem662@gmail.com> | 2022-11-20 17:36:21 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2022-11-20 17:36:21 +0100 |
commit | 7d6c75e4c737e51f997f2ac02001fad1a5627ca2 (patch) | |
tree | f315fb6e576e1b68e254be26d30d61473c91b3c8 /src/layout | |
parent | 06fbb9bc967e11151fdd1311437248cf9bc25706 (diff) | |
download | chawan-7d6c75e4c737e51f997f2ac02001fad1a5627ca2.tar.gz |
Terminal refactorings
Diffstat (limited to 'src/layout')
-rw-r--r-- | src/layout/box.nim | 4 | ||||
-rw-r--r-- | src/layout/engine.nim | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/layout/box.nim b/src/layout/box.nim index 204abc00..4875ffda 100644 --- a/src/layout/box.nim +++ b/src/layout/box.nim @@ -3,7 +3,7 @@ import options import css/stylednode import css/values import html/dom -import io/term +import io/window type #LayoutUnit* = distinct int32 @@ -22,7 +22,7 @@ type neg*: int Viewport* = ref object - term*: TermAttributes + window*: WindowAttributes root*: BlockBox BoxBuilder* = ref object of RootObj diff --git a/src/layout/engine.nim b/src/layout/engine.nim index 7b651e4f..09103129 100644 --- a/src/layout/engine.nim +++ b/src/layout/engine.nim @@ -5,13 +5,13 @@ import css/stylednode import css/values import html/tags import html/dom -import io/term +import io/window import layout/box import utils/twtstr # Build phase func px(l: CSSLength, viewport: Viewport, p = 0): int {.inline.} = - return px(l, viewport.term, p) + return px(l, viewport.window, p) type InlineState = object ictx: InlineContext @@ -25,13 +25,13 @@ func whitespacepre(computed: CSSComputedValues): bool {.inline.} = computed{"white-space"} in {WHITESPACE_PRE, WHITESPACE_PRE_WRAP} func cellwidth(viewport: Viewport): int {.inline.} = - viewport.term.ppc + viewport.window.ppc func cellwidth(ictx: InlineContext): int {.inline.} = ictx.viewport.cellwidth func cellheight(viewport: Viewport): int {.inline.} = - viewport.term.ppl + viewport.window.ppl func cellheight(ictx: InlineContext): int {.inline.} = ictx.viewport.cellheight @@ -411,7 +411,7 @@ proc newListItem(parent: BlockBox, builder: ListItemBoxBuilder): ListItemBox = result.shrink = result.computed{"width"}.auto and parent.shrink proc newBlockBox(viewport: Viewport, box: BlockBoxBuilder): BlockBox = - result = newFlowRootBox(viewport, box, viewport.term.width_px) + result = newFlowRootBox(viewport, box, viewport.window.width_px) proc newInlineBlock(viewport: Viewport, builder: InlineBlockBoxBuilder, parentWidth: int, parentHeight = none(int)): InlineBlockBox = new(result) |