mirror of
https://github.com/penpot/penpot.git
synced 2025-04-05 03:21:26 -05:00
Fix depreaction warnings (changes introduced in 2.9.0 of beicon).
This commit is contained in:
parent
a8b7f79194
commit
31b784f046
4 changed files with 22 additions and 20 deletions
|
@ -233,7 +233,7 @@
|
|||
(rx/mapcat conditional-align)
|
||||
(rx/map translate-to-canvas)
|
||||
(rx/take-until stoper)
|
||||
(rx/with-latest-from vector streams/mouse-position-ctrl))]
|
||||
(rx/with-latest vector streams/mouse-position-ctrl))]
|
||||
|
||||
(letfn [(on-position [[point ctrl?]]
|
||||
(if @start?
|
||||
|
@ -322,13 +322,13 @@
|
|||
(rx/mapcat conditional-align)
|
||||
(rx/map translate-to-canvas))
|
||||
points (->> (get-path-point-stream)
|
||||
(rx/with-latest-from vector mouse)
|
||||
(rx/with-latest vector mouse)
|
||||
(rx/map second)
|
||||
(rx/take-until stoper))
|
||||
counter (rx/merge (rx/scan #(inc %) 1 points) (rx/of 1))
|
||||
stream (->> mouse
|
||||
(rx/with-latest-from vector streams/mouse-position-ctrl)
|
||||
(rx/with-latest-from vector counter)
|
||||
(rx/with-latest vector streams/mouse-position-ctrl)
|
||||
(rx/with-latest vector counter)
|
||||
(rx/map flatten)
|
||||
(rx/take-until stoper))]
|
||||
|
||||
|
|
|
@ -26,25 +26,27 @@
|
|||
:height "100%"
|
||||
:fill "white"}])
|
||||
|
||||
(declare shape)
|
||||
(declare shape*)
|
||||
(declare shape-component)
|
||||
(declare shape-wrapper)
|
||||
|
||||
(mx/defc shape*
|
||||
[{:keys [type] :as s}]
|
||||
(mx/defc shape-wrapper
|
||||
[{:keys [type] :as shape}]
|
||||
(case type
|
||||
:group (group-shape s shape)
|
||||
:text (text-shape s)
|
||||
:icon (icon-shape s)
|
||||
:rect (rect-shape s)
|
||||
:path (path-shape s)
|
||||
:circle (circle-shape s)
|
||||
:image (let [image-id (:image s)
|
||||
:group (group-shape shape shape-component)
|
||||
:text (text-shape shape)
|
||||
:icon (icon-shape shape)
|
||||
:rect (rect-shape shape)
|
||||
:path (path-shape shape)
|
||||
:circle (circle-shape shape)
|
||||
:image (let [image-id (:image shape)
|
||||
image (get-in @*state* [:images image-id])]
|
||||
(image-shape (assoc s :image image)))))
|
||||
;; (println "shape-wrapper" image)
|
||||
(image-shape (assoc shape :image image)))))
|
||||
|
||||
(mx/defc shape
|
||||
(mx/defc shape-component
|
||||
[sid]
|
||||
(shape* (get-in @*state* [:shapes sid])))
|
||||
(let [shape (get-in @*state* [:shapes sid])]
|
||||
(shape-wrapper shape)))
|
||||
|
||||
(mx/defc page-svg
|
||||
[{:keys [metadata] :as page}]
|
||||
|
|
|
@ -224,7 +224,7 @@
|
|||
(uwrk/align-point point)
|
||||
(rx/of point))))
|
||||
(rx/take-until stoper)
|
||||
(rx/with-latest-from vector streams/mouse-position-ctrl)
|
||||
(rx/with-latest vector streams/mouse-position-ctrl)
|
||||
(rx/scan accumulate-width shape)
|
||||
(rx/map (partial calculate-ratio shape)))]
|
||||
(rx/subscribe stream
|
||||
|
|
|
@ -78,7 +78,7 @@
|
|||
(let [stream (->> streams/window-mouse-position
|
||||
(rx/filter #(:active @local))
|
||||
(rx/map #(resolve-position own %))
|
||||
(rx/with-latest-from vector streams/mouse-position-ctrl))
|
||||
(rx/with-latest vector streams/mouse-position-ctrl))
|
||||
sub (rx/on-value stream on-value)]
|
||||
(assoc own ::sub sub))))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue