From 981c578ff9f1ef33a9ab00bc0ecf8fcacabc156f Mon Sep 17 00:00:00 2001 From: Johannes Wolf <519002+johannes-wolf@users.noreply.github.com> Date: Wed, 19 Apr 2023 16:30:27 +0200 Subject: path: Use close_path() for closing paths (#801) --- library/src/visualize/path.rs | 1 + tests/ref/visualize/path.png | Bin 3405 -> 3575 bytes tests/typ/visualize/path.typ | 7 +++++++ 3 files changed, 8 insertions(+) diff --git a/library/src/visualize/path.rs b/library/src/visualize/path.rs index 436ef5f0..db062093 100644 --- a/library/src/visualize/path.rs +++ b/library/src/visualize/path.rs @@ -123,6 +123,7 @@ impl Layout for PathElem { let to_point = points[0]; add_cubic(from_point, to_point, from, to); + path.close_path(); } // Prepare fill and stroke. diff --git a/tests/ref/visualize/path.png b/tests/ref/visualize/path.png index ec537f0a..c7f710c9 100644 Binary files a/tests/ref/visualize/path.png and b/tests/ref/visualize/path.png differ diff --git a/tests/typ/visualize/path.typ b/tests/typ/visualize/path.typ index c7c1af50..d475811f 100644 --- a/tests/typ/visualize/path.typ +++ b/tests/typ/visualize/path.typ @@ -30,6 +30,13 @@ ((30%, 60%), (-20%, 0%), (0%, 0%)), ((50%, 30%), (60%, -30%), (60%, 0%)), ), + path( + stroke: 5pt, + closed: true, + (0pt, 30pt), + (30pt, 30pt), + (15pt, 0pt), + ), ) --- -- cgit v1.2.3