mirror of
https://github.com/penpot/penpot.git
synced 2025-08-07 14:38:33 +02:00
🐛 Fix image flickering on shape movement.
This commit is contained in:
parent
ccce224377
commit
6df2f20127
1 changed files with 7 additions and 3 deletions
|
@ -61,15 +61,19 @@
|
||||||
(let [selected-iref (-> (mf/deps (:id shape))
|
(let [selected-iref (-> (mf/deps (:id shape))
|
||||||
(mf/use-memo #(refs/make-selected (:id shape))))
|
(mf/use-memo #(refs/make-selected (:id shape))))
|
||||||
selected? (mf/deref selected-iref)
|
selected? (mf/deref selected-iref)
|
||||||
zoom (mf/deref refs/selected-zoom)]
|
zoom (mf/deref refs/selected-zoom)
|
||||||
|
frame-shape (mf/use-memo #(frame-shape shape-wrapper))]
|
||||||
(when (and shape (not (:hidden shape)))
|
(when (and shape (not (:hidden shape)))
|
||||||
(let [on-mouse-down #(common/on-mouse-down % shape)
|
(let [on-mouse-down #(common/on-mouse-down % shape)
|
||||||
on-context-menu #(common/on-context-menu % shape)
|
on-context-menu #(common/on-context-menu % shape)
|
||||||
shape (merge frame-default-props shape)
|
shape (merge frame-default-props shape)
|
||||||
|
|
||||||
{:keys [x y width height]} shape
|
{:keys [x y width height]} shape
|
||||||
|
|
||||||
inv-zoom (/ 1 zoom)
|
inv-zoom (/ 1 zoom)
|
||||||
childs (mapv #(get objects %) (:shapes shape))
|
childs (mapv #(get objects %) (:shapes shape))
|
||||||
ds-modifier (:displacement-modifier shape)
|
ds-modifier (:displacement-modifier shape)
|
||||||
|
|
||||||
label-pos (cond-> (gpt/point x (- y 10))
|
label-pos (cond-> (gpt/point x (- y 10))
|
||||||
(gmt/matrix? ds-modifier) (gpt/transform ds-modifier))
|
(gmt/matrix? ds-modifier) (gpt/transform ds-modifier))
|
||||||
|
|
||||||
|
@ -95,7 +99,7 @@
|
||||||
;; User may also select the frame with single click in the label
|
;; User may also select the frame with single click in the label
|
||||||
:on-click on-double-click}
|
:on-click on-double-click}
|
||||||
(:name shape)]
|
(:name shape)]
|
||||||
[:& (frame-shape shape-wrapper) {:shape shape
|
[:& frame-shape {:shape shape
|
||||||
:childs childs}]])))))
|
:childs childs}]])))))
|
||||||
|
|
||||||
(defn frame-shape
|
(defn frame-shape
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue