From 10cad69face329a949efebeb09c4ac818f06c69b Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 11 Feb 2021 14:43:54 +0100 Subject: [PATCH 1/3] :bug: Fixes problem with multiple selection and groups --- CHANGES.md | 1 + .../src/app/main/ui/workspace/sidebar/options/multiple.cljs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 5a35f2f298..0731b4cea0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -29,6 +29,7 @@ - Fix problem when pasting URL's copied from the browser url bar [Taiga #1187](https://tree.taiga.io/project/penpot/issue/1187) - Fix ordering when restoring deleted shapes in sync [Taiga #1163](https://tree.taiga.io/project/penpot/issue/1163) - Fix updates on collaborative editing not updating selection rectangles [Taiga #1127](https://tree.taiga.io/project/penpot/issue/1127) +- Fix problem with multiple selection and groups [Taiga #1128](https://tree.taiga.io/project/penpot/issue/1128) ### Community contributions by (Thank you! :heart:) diff --git a/frontend/src/app/main/ui/workspace/sidebar/options/multiple.cljs b/frontend/src/app/main/ui/workspace/sidebar/options/multiple.cljs index 3c7d587cd9..8951315718 100644 --- a/frontend/src/app/main/ui/workspace/sidebar/options/multiple.cljs +++ b/frontend/src/app/main/ui/workspace/sidebar/options/multiple.cljs @@ -152,8 +152,9 @@ (-> values (merge-attrs (select-keys shape attrs)) (merge-attrs (ut/get-text-attrs-multi content attrs)))] - :children (let [children (->> (:shapes shape []) (map #(get objects %)))] - (get-attrs children objects attr-type)) + :children (let [children (->> (:shapes shape []) (map #(get objects %))) + [new-ids new-values] (get-attrs children objects attr-type)] + [(d/concat ids new-ids) (merge-attrs values new-values)]) [])] result))] (reduce extract-attrs [[] []] shapes))) From 8cfc2ec21a53df5d159b9c986c7f362ca764a1af Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 11 Feb 2021 15:49:18 +0100 Subject: [PATCH 2/3] :bug: Fixes problem with red handler indicator on resize --- CHANGES.md | 13 +++++++------ frontend/src/app/main/data/workspace/texts.cljs | 2 +- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 0731b4cea0..474626c4df 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -16,20 +16,21 @@ ### Bugs fixed - Make the team deletion defferred (in the same way other objects). -- Problems when transforming path shapes [Taiga 1170](https://tree.taiga.io/project/penpot/issue/1170) +- Problems when transforming path shapes [Taiga #1170](https://tree.taiga.io/project/penpot/issue/1170) - Fix 500 when requestion password reset - Fix ldap function called on login click -- Fix issues when moving shapes outside groups [Taiga 1138](https://tree.taiga.io/project/penpot/issue/1138) -- Fix unexpected exception when uploading image [Taiga 1120](https://tree.taiga.io/project/penpot/issue/1120) +- Fix issues when moving shapes outside groups [Taiga #1138](https://tree.taiga.io/project/penpot/issue/1138) +- Fix unexpected exception when uploading image [Taiga #1120](https://tree.taiga.io/project/penpot/issue/1120) - Fix 404 when access shared link [#615](https://github.com/penpot/penpot/issues/615) -- Fix show correct error when google auth is disabled [Taiga 1119](https://tree.taiga.io/project/penpot/issue/1119) -- Fix apply a color to a text selection from color palette was not working [Taiga 1189](https://tree.taiga.io/project/penpot/issue/1189) -- Fix logo icon in viewer should go to dashboard [Taiga 1149](https://tree.taiga.io/project/penpot/issue/1149) +- Fix show correct error when google auth is disabled [Taiga #1119](https://tree.taiga.io/project/penpot/issue/1119) +- Fix apply a color to a text selection from color palette was not working [Taiga #1189](https://tree.taiga.io/project/penpot/issue/1189) +- Fix logo icon in viewer should go to dashboard [Taiga #1149](https://tree.taiga.io/project/penpot/issue/1149) - Fix text alignment in preview [#594](https://github.com/penpot/penpot/issues/594) - Fix problem when pasting URL's copied from the browser url bar [Taiga #1187](https://tree.taiga.io/project/penpot/issue/1187) - Fix ordering when restoring deleted shapes in sync [Taiga #1163](https://tree.taiga.io/project/penpot/issue/1163) - Fix updates on collaborative editing not updating selection rectangles [Taiga #1127](https://tree.taiga.io/project/penpot/issue/1127) - Fix problem with multiple selection and groups [Taiga #1128](https://tree.taiga.io/project/penpot/issue/1128) +- Fix problem with red handler indicator on resize [Taiga #1188](https://tree.taiga.io/project/penpot/issue/1188) ### Community contributions by (Thank you! :heart:) diff --git a/frontend/src/app/main/data/workspace/texts.cljs b/frontend/src/app/main/data/workspace/texts.cljs index 7e0174599c..27ef5ce4a1 100644 --- a/frontend/src/app/main/data/workspace/texts.cljs +++ b/frontend/src/app/main/data/workspace/texts.cljs @@ -249,7 +249,7 @@ (assoc :overflow-text true) (and (= :fixed grow-type) overflow-text (<= new-height shape-height)) - (assoc :overflow-text true) + (assoc :overflow-text false) (and (not-changed? shape-width new-width) (= grow-type :auto-width)) (-> (assoc :modifiers modifier-width) From dc0765f6b0da201ac4884c226d5ec5f9d1fa872f Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Thu, 11 Feb 2021 16:01:21 +0100 Subject: [PATCH 3/3] :sparkles: Improved calculations for auto-resize --- .../src/app/main/ui/shapes/text/styles.cljs | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/frontend/src/app/main/ui/shapes/text/styles.cljs b/frontend/src/app/main/ui/shapes/text/styles.cljs index c859d2c0cc..46839ae4f4 100644 --- a/frontend/src/app/main/ui/shapes/text/styles.cljs +++ b/frontend/src/app/main/ui/shapes/text/styles.cljs @@ -20,28 +20,31 @@ ([props] (generate-root-styles (clj->js (obj/get props "node")) props)) ([data props] (let [valign (obj/get data "vertical-align" "top") - talign (obj/get data "text-align" "flex-start") shape (obj/get props "shape") base #js {:height (or (:height shape) "100%") - :width (or (:width shape) "100%") - :display "flex"}] + :width (or (:width shape) "100%")}] (cond-> base - (= valign "top") (obj/set! "alignItems" "flex-start") - (= valign "center") (obj/set! "alignItems" "center") - (= valign "bottom") (obj/set! "alignItems" "flex-end") - - (= talign "left") (obj/set! "justifyContent" "flex-start") - (= talign "center") (obj/set! "justifyContent" "center") - (= talign "right") (obj/set! "justifyContent" "flex-end") - (= talign "justify") (obj/set! "justifyContent" "stretch"))))) + (= valign "top") (obj/set! "justifyContent" "flex-start") + (= valign "center") (obj/set! "justifyContent" "center") + (= valign "bottom") (obj/set! "justifyContent" "flex-end") + )))) (defn generate-paragraph-set-styles - ([props] (generate-paragraph-set-styles nil props)) + ([props] (generate-paragraph-set-styles (clj->js (obj/get props "node")) props)) ([data props] - ;; The position absolute is used so the paragraph is "outside" - ;; the normal layout and can grow outside its parent - ;; We use this element to measure the size of the text - (let [base #js {:display "inline-block"}] + ;; This element will control the auto-width/auto-height size for the + ;; shape. The properties try to adjust to the shape and "overflow" if + ;; the shape is not big enough. + ;; We `inherit` the property `justify-content` so it's set by the root where + ;; the property it's known. + ;; `inline-flex` is similar to flex but `overflows` outside the bounds of the + ;; parent + (let [base #js {:display "inline-flex" + :flex-direction "column" + :justify-content "inherit" + :min-height "100%" + :min-width "100%" + :vertical-align "top"}] base))) (defn generate-paragraph-styles