about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-06-29 01:11:58 +0200
committerbptato <nincsnevem662@gmail.com>2024-06-29 01:13:38 +0200
commit1ecddcefe61103846aa1a3fcbaa11178aa7a2ec1 (patch)
tree6bcb29ff00ab7675aa62c72d6a1600e303f80bad /src
parent1b0eee9d62aab586ec7c79ed00f8b85d04e9afa1 (diff)
downloadchawan-1ecddcefe61103846aa1a3fcbaa11178aa7a2ec1.tar.gz
layout: fix text-align + padding coloring
Diffstat (limited to 'src')
-rw-r--r--src/layout/engine.nim3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/layout/engine.nim b/src/layout/engine.nim
index 3acc958e..c01ef61e 100644
--- a/src/layout/engine.nim
+++ b/src/layout/engine.nim
@@ -403,7 +403,7 @@ proc shiftAtoms(ictx: var InlineContext; marginTop: LayoutUnit) =
   of scMinContent, scMaxContent: ictx.size.w
   of scFitContent: ictx.space.w.u
   of scStretch: max(ictx.size.w, ictx.space.w.u)
-  var xshift = case ictx.computed{"text-align"}
+  let xshift = case ictx.computed{"text-align"}
   of TextAlignNone: LayoutUnit(0)
   of TextAlignEnd, TextAlignRight, TextAlignChaRight:
     let width = min(width, ictx.lbstate.availableWidth)
@@ -460,6 +460,7 @@ proc shiftAtoms(ictx: var InlineContext; marginTop: LayoutUnit) =
         size: size(w = w, h = cellHeight)
       ))
   for (fragment, i) in ictx.lbstate.paddingTodo:
+    fragment.state.areas[i].offset.x += xshift
     fragment.state.areas[i].offset.y = areaY
   if ictx.space.w.t == scFitContent:
     ictx.size.w = max(totalWidth, ictx.size.w)