summaryrefslogtreecommitdiff
path: root/tests/typ/visualize
diff options
context:
space:
mode:
Diffstat (limited to 'tests/typ/visualize')
-rw-r--r--tests/typ/visualize/shape-aspect.typ10
-rw-r--r--tests/typ/visualize/shape-circle.typ6
-rw-r--r--tests/typ/visualize/shape-ellipse.typ5
-rw-r--r--tests/typ/visualize/shape-rect.typ16
-rw-r--r--tests/typ/visualize/shape-square.typ2
5 files changed, 18 insertions, 21 deletions
diff --git a/tests/typ/visualize/shape-aspect.typ b/tests/typ/visualize/shape-aspect.typ
index f2dd9b51..d2dc1140 100644
--- a/tests/typ/visualize/shape-aspect.typ
+++ b/tests/typ/visualize/shape-aspect.typ
@@ -4,9 +4,13 @@
// Test relative width and height and size that is smaller
// than default size.
#set page(width: 120pt, height: 70pt)
-#square(width: 50%, align(bottom)[A])
+#set align(center + horizon)
+#square(width: 50%, [A])
#square(height: 50%)
-#box(stack(square(size: 10pt), 5pt, square(size: 10pt, [B])))
+#box(stack(
+ square(size: 10pt),
+ square(size: 20pt, [B])
+))
---
// Test alignment in automatically sized square and circle.
@@ -37,7 +41,7 @@
// Test square that is overflowing due to its aspect ratio.
#set page(width: 40pt, height: 20pt, margin: 5pt)
#square(width: 100%) #parbreak()
-#square(width: 100%)[Hello]
+#square(width: 100%)[Hey]
---
// Size cannot be relative because we wouldn't know
diff --git a/tests/typ/visualize/shape-circle.typ b/tests/typ/visualize/shape-circle.typ
index 13ff67de..23c6fcbd 100644
--- a/tests/typ/visualize/shape-circle.typ
+++ b/tests/typ/visualize/shape-circle.typ
@@ -7,6 +7,7 @@
---
// Test auto sizing.
+#set circle(inset: 0pt)
Auto-sized circle. \
#circle(fill: rgb("eb5278"), stroke: 2pt + black,
@@ -33,13 +34,14 @@ Expanded by height.
---
// Ensure circle directly in rect works.
-#rect(width: 40pt, height: 30pt, fill: forest, circle(fill: conifer))
+#rect(width: 40pt, height: 30pt, fill: forest,
+ circle(fill: conifer))
---
// Test relative sizing.
#let centered(body) = align(center + horizon, body)
#set text(fill: white)
-#rect(width: 100pt, height: 50pt, fill: rgb("aaa"), centered[
+#rect(width: 100pt, height: 50pt, inset: 0pt, fill: rgb("aaa"), centered[
#circle(radius: 10pt, fill: eastern, centered[A]) // D=20pt
#circle(height: 60%, fill: eastern, centered[B]) // D=30pt
#circle(width: 20% + 20pt, fill: eastern, centered[C]) // D=40pt
diff --git a/tests/typ/visualize/shape-ellipse.typ b/tests/typ/visualize/shape-ellipse.typ
index ba4d0d0a..6447d1d0 100644
--- a/tests/typ/visualize/shape-ellipse.typ
+++ b/tests/typ/visualize/shape-ellipse.typ
@@ -5,6 +5,9 @@
#ellipse()
---
+#set rect(inset: 0pt)
+#set ellipse(inset: 0pt)
+
Rect in ellipse in fixed rect. \
#rect(width: 3cm, height: 2cm, fill: rgb("2a631a"),
ellipse(fill: forest, width: 100%, height: 100%,
@@ -23,4 +26,4 @@ Auto-sized ellipse. \
]
-An inline #ellipse(width: 8pt, height: 6pt, outset: (top: 3pt, rest: 5.5pt)) ellipse. \ No newline at end of file
+An inline #ellipse(width: 8pt, height: 6pt, outset: (top: 3pt, rest: 5.5pt)) ellipse.
diff --git a/tests/typ/visualize/shape-rect.typ b/tests/typ/visualize/shape-rect.typ
index 9a115e54..c8518bbd 100644
--- a/tests/typ/visualize/shape-rect.typ
+++ b/tests/typ/visualize/shape-rect.typ
@@ -8,7 +8,7 @@
#set page(width: 150pt)
// Fit to text.
-#rect(fill: conifer, inset: 3pt)[Textbox]
+#rect(fill: conifer)[Textbox]
// Empty with fixed width and height.
#block(rect(
@@ -18,7 +18,7 @@
))
// Fixed width, text height.
-#rect(width: 2cm, fill: rgb("9650d6"), inset: 5pt)[Fixed and padded]
+#rect(width: 2cm, fill: rgb("9650d6"))[Fixed and padded]
// Page width, fixed height.
#rect(height: 1cm, width: 100%, fill: rgb("734ced"))[Topleft]
@@ -45,18 +45,6 @@
]
---
-// Outset padding.
-#set raw(lang: "rust")
-#show raw: it => [
- #set text(8pt)
- #h(5.6pt, weak: true)
- #rect(radius: 3pt, outset: (y: 3pt, x: 2.5pt), fill: rgb(239, 241, 243), it)
- #h(5.6pt, weak: true)
-]
-
-Use the `*const T` pointer or the `&mut T` reference.
-
----
// Error: 15-38 unexpected key "cake", valid keys are "top-left", "top-right", "bottom-right", "bottom-left", "left", "top", "right", "bottom", and "rest"
#rect(radius: (left: 10pt, cake: 5pt))
diff --git a/tests/typ/visualize/shape-square.typ b/tests/typ/visualize/shape-square.typ
index 622fa9c8..8ac9001f 100644
--- a/tests/typ/visualize/shape-square.typ
+++ b/tests/typ/visualize/shape-square.typ
@@ -7,7 +7,7 @@
---
// Test auto-sized square.
-#square(fill: eastern, inset: 5pt)[
+#square(fill: eastern)[
#set text(fill: white, weight: "bold")
Typst
]