From 79638d4bbdc140a8dca0ccfdf70ffd607d5da251 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Tue, 16 Nov 2021 12:47:14 +0100 Subject: Don't wrap already layoutable nodes into flows/pars unnecessarily --- tests/ref/elements/circle.png | Bin 12965 -> 12498 bytes tests/ref/elements/ellipse.png | Bin 7717 -> 7146 bytes tests/ref/layout/grid-1.png | Bin 3248 -> 3255 bytes tests/typ/elements/circle.typ | 15 +++++++-------- tests/typ/elements/ellipse.typ | 6 +++--- tests/typ/layout/grid-1.typ | 24 ++++++++++++------------ tests/typ/layout/grid-3.typ | 4 ++-- tests/typ/layout/grid-4.typ | 8 ++++---- tests/typ/layout/stack-1.typ | 3 +-- 9 files changed, 29 insertions(+), 31 deletions(-) (limited to 'tests') diff --git a/tests/ref/elements/circle.png b/tests/ref/elements/circle.png index 41079fda..2b938c89 100644 Binary files a/tests/ref/elements/circle.png and b/tests/ref/elements/circle.png differ diff --git a/tests/ref/elements/ellipse.png b/tests/ref/elements/ellipse.png index 98e66902..77124e1d 100644 Binary files a/tests/ref/elements/ellipse.png and b/tests/ref/elements/ellipse.png differ diff --git a/tests/ref/layout/grid-1.png b/tests/ref/layout/grid-1.png index 06b3a231..df8ab644 100644 Binary files a/tests/ref/layout/grid-1.png and b/tests/ref/layout/grid-1.png differ diff --git a/tests/typ/elements/circle.typ b/tests/typ/elements/circle.typ index c36f9f94..4413d0d9 100644 --- a/tests/typ/elements/circle.typ +++ b/tests/typ/elements/circle.typ @@ -14,16 +14,15 @@ Auto-sized circle. \ ] Center-aligned rect in auto-sized circle. -#circle(fill: forest)[ - #align(center, center) - #rect(fill: conifer, pad(5pt)[ - But, soft! - ]) -] +#circle(fill: forest, + align(center, center, + rect(fill: conifer, pad(5pt)[But, soft!]) + ) +) -100%-width rect in auto-sized circle. \ +Rect in auto-sized circle. \ #circle(fill: forest, - rect(width: 100%, fill: conifer)[ + rect(fill: conifer)[ But, soft! what light through yonder window breaks? ] ) diff --git a/tests/typ/elements/ellipse.typ b/tests/typ/elements/ellipse.typ index 106a8172..3c8572b1 100644 --- a/tests/typ/elements/ellipse.typ +++ b/tests/typ/elements/ellipse.typ @@ -5,10 +5,10 @@ #ellipse() --- -100% rect in 100% ellipse in fixed rect. \ +Rect in ellipse in fixed rect. \ #rect(width: 3cm, height: 2cm, fill: rgb("2a631a"), - ellipse(width: 100%, height: 100%, fill: forest, - rect(width: 100%, height: 100%, fill: conifer)[ + ellipse(fill: forest, + rect(fill: conifer)[ #align(center, center) Stuff inside an ellipse! ] diff --git a/tests/typ/layout/grid-1.typ b/tests/typ/layout/grid-1.typ index 23723712..afd01a5f 100644 --- a/tests/typ/layout/grid-1.typ +++ b/tests/typ/layout/grid-1.typ @@ -7,17 +7,17 @@ #grid( columns: (auto, 1fr, 3fr, 0.25cm, 3%, 2mm + 10%), cell(0.5cm, rgb("2a631a")), - cell(100%, forest), - cell(100%, conifer), - cell(100%, rgb("ff0000")), - cell(100%, rgb("00ff00")), - cell(80%, rgb("00faf0")), - cell(1cm, rgb("00ff00")), + cell(100%, forest), + cell(100%, conifer), + cell(100%, rgb("ff0000")), + cell(100%, rgb("00ff00")), + cell(80%, rgb("00faf0")), + cell(1cm, rgb("00ff00")), cell(0.5cm, rgb("2a631a")), - cell(100%, forest), - cell(100%, conifer), - cell(100%, rgb("ff0000")), - cell(100%, rgb("00ff00")), + cell(100%, forest), + cell(100%, conifer), + cell(100%, rgb("ff0000")), + cell(100%, rgb("00ff00")), ) #grid() @@ -29,7 +29,7 @@ row-gutter: 1fr, rect(fill: eastern)[dddaa aaa aaa], rect(fill: conifer)[ccc], - rect(width: 100%, fill: rgb("dddddd"))[aaa], + rect(fill: rgb("dddddd"))[aaa], ) --- @@ -39,6 +39,6 @@ columns: (1fr,), rows: (1fr, auto, 2fr), [], - box(width: 100%)[A bit more to the top], + [A bit more to the top], [], ) diff --git a/tests/typ/layout/grid-3.typ b/tests/typ/layout/grid-3.typ index 42d2ce97..af971875 100644 --- a/tests/typ/layout/grid-3.typ +++ b/tests/typ/layout/grid-3.typ @@ -67,9 +67,9 @@ columns: 2 * (1fr,), rows: (1fr, 2fr, auto, 1fr, 1cm), row-gutter: 10pt, - rect(height: 100%, width: 100%, fill: rgb("ff0000"))[No height], + rect(fill: rgb("ff0000"))[No height], [foo], - rect(height: 100%, width: 100%, fill: rgb("fc0030"))[Still no height], + rect(fill: rgb("fc0030"))[Still no height], [bar], [The nature of being itself is in question. Am I One? What is being alive?], [baz], diff --git a/tests/typ/layout/grid-4.typ b/tests/typ/layout/grid-4.typ index 02ac0486..d6aa6358 100644 --- a/tests/typ/layout/grid-4.typ +++ b/tests/typ/layout/grid-4.typ @@ -15,10 +15,10 @@ #grid( columns: (1fr,) * 4, rows: (1cm,), - rect(width: 50%, height: 100%, fill: conifer), - rect(width: 50%, height: 100%, fill: forest), - rect(width: 50%, height: 100%, fill: conifer), - rect(width: 50%, height: 100%, fill: forest), + rect(width: 50%, fill: conifer), + rect(width: 50%, fill: forest), + rect(width: 50%, fill: conifer), + rect(width: 50%, fill: forest), ) --- diff --git a/tests/typ/layout/stack-1.typ b/tests/typ/layout/stack-1.typ index b8d8a09d..42a0137d 100644 --- a/tests/typ/layout/stack-1.typ +++ b/tests/typ/layout/stack-1.typ @@ -13,9 +13,8 @@ w => rect(width: w, height: 10pt, fill: next()) } -#let items = for w in widths { (shaded(w),) } +#let items = for w in widths { (align(right, shaded(w)),) } -#align(right) #page(width: 50pt, margins: 0pt) #stack(dir: btt, ..items) #pagebreak() -- cgit v1.2.3