From 6a0d13171575847aa445944da1ad698eb5e85eed Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 8 Apr 2026 12:06:45 +0000 Subject: [PATCH] :bug: Fix swapped move-to/line-to type codes in PathData binary readers The impl-walk, impl-reduce, and impl-lookup functions had the binary type codes for move-to and line-to swapped (1 mapped to :line-to and 2 to :move-to). This is inconsistent with from-plain, read-segment, to-string-segment*, and the Rust RawSegmentData enum which all use 1=move-to and 2=line-to. The swap caused incorrect command types to be reported to callers like get-handlers and get-points. Signed-off-by: Andrey Antukh --- common/src/app/common/types/path/impl.cljc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common/src/app/common/types/path/impl.cljc b/common/src/app/common/types/path/impl.cljc index 959a11bf6f..ecdd7ddb09 100644 --- a/common/src/app/common/types/path/impl.cljc +++ b/common/src/app/common/types/path/impl.cljc @@ -128,8 +128,8 @@ x (buf/read-float buffer (+ offset 20)) y (buf/read-float buffer (+ offset 24)) type (case type - 1 :line-to - 2 :move-to + 1 :move-to + 2 :line-to 3 :curve-to 4 :close-path) res (f type c1x c1y c2x c2y x y)] @@ -153,8 +153,8 @@ x (buf/read-float buffer (+ offset 20)) y (buf/read-float buffer (+ offset 24)) type (case type - 1 :line-to - 2 :move-to + 1 :move-to + 2 :line-to 3 :curve-to 4 :close-path) result (f result index type c1x c1y c2x c2y x y)] @@ -174,8 +174,8 @@ x (buf/read-float buffer (+ offset 20)) y (buf/read-float buffer (+ offset 24)) type (case type - 1 :line-to - 2 :move-to + 1 :move-to + 2 :line-to 3 :curve-to 4 :close-path)] #?(:clj (f type c1x c1y c2x c2y x y)