0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-26 08:29:42 -05:00

Merge pull request #1099 from penpot/fix-vertical-resize

🐛 Fix vertical resize when nested shapes
This commit is contained in:
Andrey Antukh 2021-07-20 09:42:44 +02:00 committed by GitHub
commit b483513fa8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 8 deletions

View file

@ -60,7 +60,7 @@
(a/close! output))) (a/close! output)))
(defn- send-mattermost-notification! (defn- send-mattermost-notification!
[cfg {:keys [host version id] :as cdata}] [cfg {:keys [host id] :as cdata}]
(try (try
(let [uri (:uri cfg) (let [uri (:uri cfg)
text (str "Unhandled exception (host: " host ", url: " (cfg/get :public-uri) "/dbg/error-by-id/" id "\n" text (str "Unhandled exception (host: " host ", url: " (cfg/get :public-uri) "/dbg/error-by-id/" id "\n"

View file

@ -597,10 +597,8 @@
(assoc :resize-origin (:resize-origin parent-modifiers) (assoc :resize-origin (:resize-origin parent-modifiers)
:resize-vector (gpt/point (:x (:resize-vector parent-modifiers)) 1)) :resize-vector (gpt/point (:x (:resize-vector parent-modifiers)) 1))
(and (:resize-vector-2 parent-modifiers) ;; resize-vector-2 is always for vertical modifiers, so no need to
(not (mth/close? (:x (:resize-vector-2 parent-modifiers)) 1))) ;; check it here.
(assoc :resize-origin-2 (:resize-origin-2 parent-modifiers)
:resize-vector-2 (gpt/point (:x (:resize-vector-2 parent-modifiers)) 1))
(:displacement parent-modifiers) (:displacement parent-modifiers)
(assoc :displacement (assoc :displacement
@ -654,10 +652,12 @@
(assoc :resize-origin (:resize-origin parent-modifiers) (assoc :resize-origin (:resize-origin parent-modifiers)
:resize-vector (gpt/point 1 (:y (:resize-vector parent-modifiers)))) :resize-vector (gpt/point 1 (:y (:resize-vector parent-modifiers))))
;; If there is a resize-vector-2, this means that we come from a recursive
;; call, and the resize-vector has no vertical data, so we may override it.
(and (:resize-vector-2 parent-modifiers) (and (:resize-vector-2 parent-modifiers)
(not (mth/close? (:y (:resize-vector-2 parent-modifiers)) 1))) (not (mth/close? (:y (:resize-vector-2 parent-modifiers)) 1)))
(assoc :resize-origin-2 (:resize-origin-2 parent-modifiers) (assoc :resize-origin (:resize-origin-2 parent-modifiers)
:resize-vector-2 (gpt/point 1 (:y (:resize-vector-2 parent-modifiers)))) :resize-vector (gpt/point 1 (:y (:resize-vector-2 parent-modifiers))))
(:displacement parent-modifiers) (:displacement parent-modifiers)
(assoc :displacement (assoc :displacement

View file

@ -258,7 +258,7 @@
(defmethod migrate 11 (defmethod migrate 11
[data] [data]
(letfn [(update-object [objects id shape] (letfn [(update-object [objects _id shape]
(if (= :frame (:type shape)) (if (= :frame (:type shape))
(d/update-when shape :shapes (fn [shapes] (d/update-when shape :shapes (fn [shapes]
(filterv (fn [id] (contains? objects id)) shapes))) (filterv (fn [id] (contains? objects id)) shapes)))