diff options
author | bptato <nincsnevem662@gmail.com> | 2025-02-19 18:39:36 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2025-02-19 18:39:36 +0100 |
commit | b65993b77789ddbde72f65db648ab993a5097121 (patch) | |
tree | c4fb5074e9cf65150e29fe223baab40aaf54a4cf /src/css | |
parent | 18df64e54b8aefc4affabf23cec0b6e4e4b7fec4 (diff) | |
download | chawan-b65993b77789ddbde72f65db648ab993a5097121.tar.gz |
render, pager: fix canvas background painting order
We were painting the background box in render for dump mode, but this conflicted with the standard requirement that the canvas be painted before other elements. So now we handle this directly in the pager. Conveniently enough, this also fixes the issue of canvas color adding pointless spacing to pages (which often made the selection feature less useful.)
Diffstat (limited to 'src/css')
-rw-r--r-- | src/css/render.nim | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/css/render.nim b/src/css/render.nim index 565b7c9e..d613fb9c 100644 --- a/src/css/render.nim +++ b/src/css/render.nim @@ -450,13 +450,14 @@ proc renderBlock(grid: var FlexibleGrid; state: var RenderState; #TODO bgimage # note: this eats the alpha state.bgcolor = bgcolor - let ix = toInt(offset.x) - let iy = toInt(offset.y) - let e = offset + box.state.size - let iex = toInt(e.x) - let iey = toInt(e.y) - grid.paintBackground(state, bgcolor, ix, iy, iex, iey, box.element, - bgcolor0.a, box.render.clipBox) + else: + let ix = toInt(offset.x) + let iy = toInt(offset.y) + let e = offset + box.state.size + let iex = toInt(e.x) + let iey = toInt(e.y) + grid.paintBackground(state, bgcolor, ix, iy, iex, iey, box.element, + bgcolor0.a, box.render.clipBox) if box.computed{"background-image"} != nil: # ugly hack for background-image display... TODO actually display images const s = "[img]" |