From 38dd6da237b8d1ea86f82069338d9ceae479d180 Mon Sep 17 00:00:00 2001 From: Wannes Malfait <46323945+WannesMalfait@users.noreply.github.com> Date: Mon, 23 Jun 2025 16:58:04 +0200 Subject: Fix stroke cap of shapes with partial stroke (#5688) --- tests/ref/rect-stroke-caps.png | Bin 0 -> 252 bytes tests/suite/visualize/rect.typ | 16 ++++++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 tests/ref/rect-stroke-caps.png (limited to 'tests') diff --git a/tests/ref/rect-stroke-caps.png b/tests/ref/rect-stroke-caps.png new file mode 100644 index 00000000..13a34ad9 Binary files /dev/null and b/tests/ref/rect-stroke-caps.png differ diff --git a/tests/suite/visualize/rect.typ b/tests/suite/visualize/rect.typ index a659287e..ba5792b7 100644 --- a/tests/suite/visualize/rect.typ +++ b/tests/suite/visualize/rect.typ @@ -54,6 +54,22 @@ #v(3pt) #rect(width: 20pt, height: 20pt, stroke: (thickness: 5pt, join: "round")) +--- rect-stroke-caps --- +// Separated segments +#rect(width: 20pt, height: 20pt, stroke: ( + left: (cap: "round", thickness: 5pt), + right: (cap: "square", thickness: 7pt), +)) +// Joined segment with different caps. +#rect(width: 20pt, height: 20pt, stroke: ( + left: (cap: "round", thickness: 5pt), + top: (cap: "square", thickness: 7pt), +)) +// No caps when there is a radius for that corner. +#rect(width: 20pt, height: 20pt, radius: (top: 3pt), stroke: ( + left: (cap: "round", thickness: 5pt), + top: (cap: "square", thickness: 7pt), +)) --- red-stroke-bad-type --- // Error: 15-21 expected length, color, gradient, tiling, dictionary, stroke, none, or auto, found array #rect(stroke: (1, 2)) -- cgit v1.2.3