mirror of
https://github.com/penpot/penpot.git
synced 2025-06-09 14:12:34 +02: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/mapcat conditional-align)
|
||||||
(rx/map translate-to-canvas)
|
(rx/map translate-to-canvas)
|
||||||
(rx/take-until stoper)
|
(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?]]
|
(letfn [(on-position [[point ctrl?]]
|
||||||
(if @start?
|
(if @start?
|
||||||
|
@ -322,13 +322,13 @@
|
||||||
(rx/mapcat conditional-align)
|
(rx/mapcat conditional-align)
|
||||||
(rx/map translate-to-canvas))
|
(rx/map translate-to-canvas))
|
||||||
points (->> (get-path-point-stream)
|
points (->> (get-path-point-stream)
|
||||||
(rx/with-latest-from vector mouse)
|
(rx/with-latest vector mouse)
|
||||||
(rx/map second)
|
(rx/map second)
|
||||||
(rx/take-until stoper))
|
(rx/take-until stoper))
|
||||||
counter (rx/merge (rx/scan #(inc %) 1 points) (rx/of 1))
|
counter (rx/merge (rx/scan #(inc %) 1 points) (rx/of 1))
|
||||||
stream (->> mouse
|
stream (->> mouse
|
||||||
(rx/with-latest-from vector streams/mouse-position-ctrl)
|
(rx/with-latest vector streams/mouse-position-ctrl)
|
||||||
(rx/with-latest-from vector counter)
|
(rx/with-latest vector counter)
|
||||||
(rx/map flatten)
|
(rx/map flatten)
|
||||||
(rx/take-until stoper))]
|
(rx/take-until stoper))]
|
||||||
|
|
||||||
|
|
|
@ -26,25 +26,27 @@
|
||||||
:height "100%"
|
:height "100%"
|
||||||
:fill "white"}])
|
:fill "white"}])
|
||||||
|
|
||||||
(declare shape)
|
(declare shape-component)
|
||||||
(declare shape*)
|
(declare shape-wrapper)
|
||||||
|
|
||||||
(mx/defc shape*
|
(mx/defc shape-wrapper
|
||||||
[{:keys [type] :as s}]
|
[{:keys [type] :as shape}]
|
||||||
(case type
|
(case type
|
||||||
:group (group-shape s shape)
|
:group (group-shape shape shape-component)
|
||||||
:text (text-shape s)
|
:text (text-shape shape)
|
||||||
:icon (icon-shape s)
|
:icon (icon-shape shape)
|
||||||
:rect (rect-shape s)
|
:rect (rect-shape shape)
|
||||||
:path (path-shape s)
|
:path (path-shape shape)
|
||||||
:circle (circle-shape s)
|
:circle (circle-shape shape)
|
||||||
:image (let [image-id (:image s)
|
:image (let [image-id (:image shape)
|
||||||
image (get-in @*state* [:images image-id])]
|
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]
|
[sid]
|
||||||
(shape* (get-in @*state* [:shapes sid])))
|
(let [shape (get-in @*state* [:shapes sid])]
|
||||||
|
(shape-wrapper shape)))
|
||||||
|
|
||||||
(mx/defc page-svg
|
(mx/defc page-svg
|
||||||
[{:keys [metadata] :as page}]
|
[{:keys [metadata] :as page}]
|
||||||
|
|
|
@ -224,7 +224,7 @@
|
||||||
(uwrk/align-point point)
|
(uwrk/align-point point)
|
||||||
(rx/of point))))
|
(rx/of point))))
|
||||||
(rx/take-until stoper)
|
(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/scan accumulate-width shape)
|
||||||
(rx/map (partial calculate-ratio shape)))]
|
(rx/map (partial calculate-ratio shape)))]
|
||||||
(rx/subscribe stream
|
(rx/subscribe stream
|
||||||
|
|
|
@ -78,7 +78,7 @@
|
||||||
(let [stream (->> streams/window-mouse-position
|
(let [stream (->> streams/window-mouse-position
|
||||||
(rx/filter #(:active @local))
|
(rx/filter #(:active @local))
|
||||||
(rx/map #(resolve-position own %))
|
(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)]
|
sub (rx/on-value stream on-value)]
|
||||||
(assoc own ::sub sub))))
|
(assoc own ::sub sub))))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue