diff options
author | bptato <nincsnevem662@gmail.com> | 2023-01-03 03:28:49 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2023-01-03 03:31:59 +0100 |
commit | 222487b3a20dd18a3f024249a2cb90d00ce535bd (patch) | |
tree | a7a120afe25190dd9377194e4827ced21ef495e3 /src/render | |
parent | 1a9acf7046565ac281834a5cf2c1d590da159e86 (diff) | |
download | chawan-222487b3a20dd18a3f024249a2cb90d00ce535bd.tar.gz |
renderdocument: fix crash for image text
We need to check if y >= 0, or it fails.
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/renderdocument.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/render/renderdocument.nim b/src/render/renderdocument.nim index 46d8a003..fd4be8da 100644 --- a/src/render/renderdocument.nim +++ b/src/render/renderdocument.nim @@ -311,7 +311,8 @@ proc renderBlockContext(grid: var FlexibleGrid, ctx: BlockBox, x, y: int, window x += ctx.width div 2 x = x div window.ppc y = y div window.ppl - grid.setText(s, ComputedFormat(node: ctx.node), x, y) + if y >= 0 and x + w >= 0: + grid.setText(s, ComputedFormat(node: ctx.node), x, y) if ctx of ListItemBox: let ctx = ListItemBox(ctx) |