about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-12-25 17:17:10 +0100
committerbptato <nincsnevem662@gmail.com>2022-12-25 17:18:33 +0100
commit2b940385bf4765450f3666850b5f56930a5c4bf9 (patch)
tree1c371cee5936e3e40bec11d58a3cd7beb4fb302d
parent412dafe1327d64793a9fb66814211db4a6c4ced2 (diff)
downloadchawan-2b940385bf4765450f3666850b5f56930a5c4bf9.tar.gz
layout/engine: use spec in positionBlocks
-rw-r--r--src/layout/engine.nim5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/layout/engine.nim b/src/layout/engine.nim
index fd4f4a1d..aa0567bb 100644
--- a/src/layout/engine.nim
+++ b/src/layout/engine.nim
@@ -709,14 +709,13 @@ proc positionBlocks(box: BlockBox) =
   template apply_child(child: BlockBox) =
     child.offset.y = y
     child.offset.x = x
-    case
-    box.computed{"text-align"}
+    case box.computed{"text-align"}
     of TEXT_ALIGN_CHA_CENTER:
       child.offset.x -= child.width div 2
     of TEXT_ALIGN_CHA_LEFT: discard
     of TEXT_ALIGN_CHA_RIGHT:
       child.offset.x -= child.width
-    elif not child.computed{"width"}.auto and child.contentWidth < box.contentWidth:
+    elif spec and child.contentWidth < box.contentWidth:
       let margin_left = child.computed{"margin-left"}
       let margin_right = child.computed{"margin-right"}
       if margin_left.auto and margin_right.auto:
> 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274