0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 08:20:45 -05:00

🐛 Fix selrect renderning on move on path based shapes.

Taiga Issue: https://tree.taiga.io/project/uxbox/issue/272
This commit is contained in:
Andrey Antukh 2019-07-22 11:03:22 +02:00
parent 125e7375c0
commit 2b81832b67
3 changed files with 21 additions and 17 deletions

View file

@ -10,20 +10,15 @@
[cljs.spec.alpha :as s]
[cuerdas.core :as str]
[lentes.core :as l]
[potok.core :as ptk]
[rumext.core :as mx]
[rumext.alpha :as mf]
[uxbox.builtins.icons :as i]
[uxbox.main.data.users :as udu]
[uxbox.main.store :as st]
[uxbox.main.ui.messages :refer [messages-widget]]
[uxbox.main.ui.settings.header :refer [header]]
[uxbox.util.dom :as dom]
[uxbox.util.data :refer [read-string]]
[uxbox.util.forms :as fm]
[uxbox.util.i18n :as i18n :refer [tr]]
[uxbox.util.interop :refer [iterable->seq]]
[uxbox.util.router :as r]))
[uxbox.util.interop :refer [iterable->seq]]))
(def form-data (fm/focus-data :profile st/state))

View file

@ -199,18 +199,25 @@
(rx/subscribe stream on-move))))
(mx/defc path-edition-selection-handlers
[{:keys [id segments] :as shape} zoom]
[{:keys [id segments modifiers] :as shape} zoom]
(letfn [(on-mouse-down [index event]
(dom/stop-propagation event)
(start-path-edition id index))]
[:g.controls
(for [[index {:keys [x y]}] (map-indexed vector segments)]
[:circle {:cx x :cy y
:r (/ 6.0 zoom)
:on-mouse-down (partial on-mouse-down index)
:fill "#31e6e0"
:stroke "#28c4d4"
:style {:cursor "pointer"}}])]))
(let [{:keys [displacement]} modifiers
segments (if displacement
(map #(gpt/transform % displacement) segments)
segments)]
[:g.controls
(for [[index {:keys [x y]}] (map-indexed vector segments)]
[:circle {:cx x :cy y
:r (/ 6.0 zoom)
:key index
:on-mouse-down (partial on-mouse-down index)
:fill "#31e6e0"
:stroke "#28c4d4"
:style {:cursor "pointer"}}])])))
(mx/defc multiple-selection-handlers
{:mixins [mx/static]}
@ -272,8 +279,9 @@
(text-edition-selection-handlers zoom))
(= type :path)
(if (= @refs/selected-edition (:id shape))
(path-edition-selection-handlers shape zoom)
(if (= edition? (:id shape))
(-> (assoc shape :modifiers (get modifiers id))
(path-edition-selection-handlers zoom))
(-> (assoc shape :modifiers (get modifiers id))
(single-selection-handlers zoom)))

View file

@ -54,6 +54,7 @@
{:optimizations :advanced
:pretty-print false
:static-fns true
;; :fn-invoke-direct true
:elide-asserts true})))
(defmethod task "build"