about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-07-12 20:36:51 +0200
committerbptato <nincsnevem662@gmail.com>2024-07-12 20:41:01 +0200
commitbf231d2e50c342fdd688b7e944ff5c934610e08b (patch)
tree63098e19c65d0d49f3db860824c69347e5196dd2 /src
parent0db193e65412804f30bf40d586d000c7599b8d24 (diff)
downloadchawan-bf231d2e50c342fdd688b7e944ff5c934610e08b.tar.gz
renderdocument: fix clickable images
Paint the background with the current color, so that it gets associated
with the owner styled node.

(I didn't want to do this because it's slow, but otherwise image-mode
gets very annoying to use.)
Diffstat (limited to 'src')
-rw-r--r--src/layout/renderdocument.nim5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/layout/renderdocument.nim b/src/layout/renderdocument.nim
index bda1371f..de324f37 100644
--- a/src/layout/renderdocument.nim
+++ b/src/layout/renderdocument.nim
@@ -387,6 +387,11 @@ proc renderInlineFragment(grid: var FlexibleGrid; state: var RenderState;
       of iatSpacing:
         grid.setSpacing(state, atom, offset, format, fragment.node)
       of iatImage:
+        let x1 = offset.x.toInt
+        let y1 = offset.y.toInt
+        let x2 = (offset.x + atom.size.w).toInt
+        let y2 = (offset.y + atom.size.h).toInt
+        grid.paintBackground(state, bgcolor, x1, y1, x2, y2, fragment.node)
         state.images.add(PosBitmap(
           x: (offset.x div state.attrs.ppc).toInt,
           y: (offset.y div state.attrs.ppl).toInt,