From b6b4e896e07f143484e22cf45fb7658b10af084d Mon Sep 17 00:00:00 2001 From: bptato Date: Wed, 8 Jun 2022 18:04:59 +0200 Subject: Simplify offset, fix a text node bug --- src/render/renderdocument.nim | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/render') diff --git a/src/render/renderdocument.nim b/src/render/renderdocument.nim index 798709c4..3dc72c38 100644 --- a/src/render/renderdocument.nim +++ b/src/render/renderdocument.nim @@ -205,8 +205,8 @@ proc paintBackground(lines: var FlexibleGrid, color: CSSColor, startx, starty, e proc renderBlockContext(grid: var FlexibleGrid, ctx: BlockContext, x, y: int, term: TermAttributes) proc renderInlineContext(grid: var FlexibleGrid, ctx: InlineContext, x, y: int, term: TermAttributes) = - let x = x + ctx.relx - let y = y + ctx.rely + let x = x + ctx.offset.x + let y = y + ctx.offset.y for row in ctx.rows: let x = x + row.relx let y = y + row.rely @@ -232,8 +232,8 @@ proc renderBlockContext(grid: var FlexibleGrid, ctx: BlockContext, x, y: int, te while stack.len > 0: var (ctx, x, y) = stack.pop() - x += ctx.offset.absx - y += ctx.offset.absy + x += ctx.offset.x + y += ctx.offset.y if ctx.specified{"background-color"}.rgba.a != 0: #TODO color blending grid.paintBackground(ctx.specified{"background-color"}, x, y, x + ctx.width, y + ctx.height, term) -- cgit