0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-02-09 16:48:16 -05:00

Merge remote-tracking branch 'origin/staging'

This commit is contained in:
Alejandro Alonso 2024-04-10 09:31:21 +02:00
commit 9adfaae6bc
5 changed files with 7 additions and 11 deletions

View file

@ -509,6 +509,7 @@
(every? nil?)))]
(or
;;We don't want to change the structure of component copies
(ctk/in-component-copy? parent)
(has-any-copy-parent? objects parent)
;; If we are moving something containing a main instance the container can't be part of a component (neither main nor copy)
(and selected-main-instance? parent-in-component?)

View file

@ -387,7 +387,7 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn update-shape-flags
[ids {:keys [blocked hidden transforming undo-group] :as flags}]
[ids {:keys [blocked hidden undo-group] :as flags}]
(dm/assert!
"expected valid coll of uuids"
(every? uuid? ids))
@ -403,15 +403,14 @@
(fn [obj]
(cond-> obj
(boolean? blocked) (assoc :blocked blocked)
(boolean? hidden) (assoc :hidden hidden)
(boolean? transforming) (assoc :transforming transforming)))
(boolean? hidden) (assoc :hidden hidden)))
objects (wsh/lookup-page-objects state)
;; We have change only the hidden behaviour, to hide only the
;; selected shape, block behaviour remains the same.
ids (if (boolean? blocked)
(into ids (->> ids (mapcat #(cfh/get-children-ids objects %))))
ids)]
(rx/of (dch/update-shapes ids update-fn {:attrs #{:blocked :hidden :transforming} :undo-group undo-group}))))))
(rx/of (dch/update-shapes ids update-fn {:attrs #{:blocked :hidden} :undo-group undo-group}))))))
(defn toggle-visibility-selected
[]

View file

@ -28,7 +28,6 @@
[app.main.data.workspace.collapse :as dwc]
[app.main.data.workspace.modifiers :as dwm]
[app.main.data.workspace.selection :as dws]
[app.main.data.workspace.shapes :as dwsh]
[app.main.data.workspace.state-helpers :as wsh]
[app.main.data.workspace.undo :as dwu]
[app.main.snap :as snap]
@ -291,10 +290,10 @@
ptk/WatchEvent
(watch [_ _ stream]
(rx/concat
(rx/of (dwsh/update-shape-flags ids {:transforming true}))
(rx/of #(assoc-in % [:workspace-local :transform] :move))
(->> (rx/timer 1000)
(rx/map (fn []
(dwsh/update-shape-flags ids {:transforming false})))
#(assoc-in % [:workspace-local :transform] nil)))
(rx/take-until
(rx/filter (ptk/type? ::trigger-bounding-box-cloaking) stream)))))))

View file

@ -113,8 +113,7 @@
(defn- show-outline?
[shape]
(and (not (:hidden shape))
(not (:blocked shape))
(not (:transforming shape))))
(not (:blocked shape))))
(mf/defc shape-outlines
{::mf/wrap-props false}

View file

@ -321,7 +321,6 @@
transform (gsh/transform-str shape)]
(when (and (some? selrect)
(not (:transforming shape))
(not (or (= transform-type :move)
(= transform-type :rotate))))
[:g.controls {:pointer-events (if ^boolean disable-handlers "none" "visible")}
@ -356,7 +355,6 @@
(and flip-y (not flip-x)))]
(when (and (not ^boolean read-only?)
(not (:transforming shape))
(not (or (= transform-type :move)
(= transform-type :rotate))))