diff --git a/common/src/app/common/types/path/impl.cljc b/common/src/app/common/types/path/impl.cljc index 13759af25b..3e8a6ab148 100644 --- a/common/src/app/common/types/path/impl.cljc +++ b/common/src/app/common/types/path/impl.cljc @@ -33,7 +33,7 @@ (defprotocol ITransformable (-transform [_ m] "apply a transform") - (-walk [_ f])) + (-walk [_ f initial])) (defn- transform! "Apply a transformation to a segment located under specified offset" @@ -260,9 +260,9 @@ (recur (inc index))))) (PathData. size buffer nil))) - (-walk [_ f] + (-walk [_ f initial] (loop [index 0 - result (transient [])] + result (transient initial)] (if (< index size) (let [offset (* index SEGMENT-BYTE-SIZE) type (.getShort ^ByteBuffer buffer offset) @@ -367,11 +367,11 @@ (recur (inc index))))) (PathData. size buffer dview (weak-map/create) nil))) - (-walk [_ f] + (-walk [_ f initial] (let [farray (js/Float32Array. buffer) iarray (js/Int32Array. buffer)] (loop [index 0 - result (transient [])] + result (transient initial)] (if (< index size) (let [offset (* index SEGMENT-BYTE-SIZE) type (.getInt16 dview offset) diff --git a/common/src/app/common/types/path/segment.cljc b/common/src/app/common/types/path/segment.cljc index 22c8183d18..b333284c1d 100644 --- a/common/src/app/common/types/path/segment.cljc +++ b/common/src/app/common/types/path/segment.cljc @@ -174,7 +174,8 @@ (impl/-walk content (fn [type _ _ _ _ x y] (when (not= type :close-path) - (gpt/point x y)))))) + (gpt/point x y))) + []))) (defn segments->content ([segments]