about summary refs log tree commit diff stats
path: root/src/layout
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-12-31 15:25:17 +0100
committerbptato <nincsnevem662@gmail.com>2022-12-31 15:25:17 +0100
commita7cc646579489743d5b6ae5b8c6d1646a10710e1 (patch)
tree414d5c57febcffae29511bd5ce539bbcc7abe5c5 /src/layout
parent7da10cb7dae4dc6905dec4c50d0d31714a543ae5 (diff)
downloadchawan-a7cc646579489743d5b6ae5b8c6d1646a10710e1.tar.gz
layout/engine: fix crash on padding-right
Diffstat (limited to 'src/layout')
-rw-r--r--src/layout/box.nim1
-rw-r--r--src/layout/engine.nim2
2 files changed, 1 insertions, 2 deletions
diff --git a/src/layout/box.nim b/src/layout/box.nim
index cc34c41c..8a5c33da 100644
--- a/src/layout/box.nim
+++ b/src/layout/box.nim
@@ -34,7 +34,6 @@ type
 
   InlineBoxBuilder* = ref object of BoxBuilder
     text*: seq[string]
-    ictx*: InlineContext
     newline*: bool
 
   BlockBoxBuilder* = ref object of BoxBuilder
diff --git a/src/layout/engine.nim b/src/layout/engine.nim
index 41b195bf..6cb12510 100644
--- a/src/layout/engine.nim
+++ b/src/layout/engine.nim
@@ -697,7 +697,7 @@ proc buildInline(ictx: InlineContext, box: InlineBoxBuilder) =
   let padding_right = box.computed{"padding-right"}.px(ictx.viewport, ictx.contentWidth)
   if padding_right > 0:
     # I don't like this, but it works...
-    box.ictx.currentLine.addSpacing(padding_right, max(ictx.currentLine.height, 1), paddingformat)
+    ictx.currentLine.addSpacing(padding_right, max(ictx.currentLine.height, 1), paddingformat)
 
   let margin_right = box.computed{"margin-right"}.px(ictx.viewport, ictx.contentWidth)
   ictx.currentLine.width += margin_right