@@ -371,23 +371,6 @@ proc computeLayout*(parent, node: Node) =
371
371
for n in node.nodes:
372
372
computeLayout(node, n)
373
373
374
- # Typeset text
375
- if node.kind == nkText:
376
- computeTextLayout(node)
377
- print node.textLayoutWidth
378
- print node.textLayoutHeight
379
- case node.textStyle.autoResize:
380
- of tsNone:
381
- # Fixed sized text node.
382
- discard
383
- of tsHeight:
384
- # Text will grow down.
385
- node.box.h = node.textLayoutHeight
386
- of tsWidthAndHeight:
387
- # Text will grow down and wide.
388
- node.box.w = node.textLayoutWidth
389
- node.box.h = node.textLayoutHeight
390
-
391
374
# Constraints code.
392
375
case node.constraintsVertical:
393
376
of cMin: discard
@@ -421,6 +404,21 @@ proc computeLayout*(parent, node: Node) =
421
404
let offset = floor((node.orgBox.h - parent.orgBox.h) / 2.0 + node.orgBox.y)
422
405
node.box.y = floor((parent.box.h - node.box.h) / 2.0) + offset
423
406
407
+ # Typeset text
408
+ if node.kind == nkText:
409
+ computeTextLayout(node)
410
+ case node.textStyle.autoResize:
411
+ of tsNone:
412
+ # Fixed sized text node.
413
+ discard
414
+ of tsHeight:
415
+ # Text will grow down.
416
+ node.box.h = node.textLayoutHeight
417
+ of tsWidthAndHeight:
418
+ # Text will grow down and wide.
419
+ node.box.w = node.textLayoutWidth
420
+ node.box.h = node.textLayoutHeight
421
+
424
422
# Auto-layout code.
425
423
if node.layoutMode == lmVertical:
426
424
if node.counterAxisSizingMode == csAuto:
0 commit comments