From 782e0604482d314b19bf0f58d7961f0101ae650f Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Mon, 7 Jun 2021 09:44:12 +0200 Subject: [PATCH 1/6] :paperclip: Add minior adaptations to main docker files. --- docker/images/Dockerfile.backend | 4 ++-- docker/images/Dockerfile.frontend | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/images/Dockerfile.backend b/docker/images/Dockerfile.backend index 443bb3371d..458418e0e6 100644 --- a/docker/images/Dockerfile.backend +++ b/docker/images/Dockerfile.backend @@ -40,6 +40,6 @@ RUN set -eux; \ rm -rf /tmp/openjdk.tar.gz; ENV JAVA_HOME=/usr/lib/jvm/openjdk16 PATH="/usr/lib/jvm/openjdk16/bin:$PATH" -ADD ./bundle-app/backend/ /opt/bundle/ -WORKDIR /opt/bundle +ADD ./bundle-backend/ /opt/penpot/backend/ +WORKDIR /opt/penpot/backend CMD ["/bin/bash", "run.sh"] diff --git a/docker/images/Dockerfile.frontend b/docker/images/Dockerfile.frontend index c1946adea2..697a9c0768 100644 --- a/docker/images/Dockerfile.frontend +++ b/docker/images/Dockerfile.frontend @@ -1,7 +1,7 @@ FROM nginx:latest LABEL maintainer="Andrey Antukh " -ADD ./bundle-app/frontend /var/www/app/ +ADD ./bundle-frontend/ /var/www/app/ ADD ./files/config.js /var/www/app/js/config.js ADD ./files/nginx.conf /etc/nginx/nginx.conf ADD ./files/nginx-entrypoint.sh /entrypoint.sh From ae4b743ea4e94ba238a367f92c87bb144fa1ff16 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 16 Jun 2021 16:14:44 +0200 Subject: [PATCH 2/6] :bug: Add missing system deps to the default docker backend image. --- docker/images/Dockerfile.backend | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/docker/images/Dockerfile.backend b/docker/images/Dockerfile.backend index 458418e0e6..987f5470af 100644 --- a/docker/images/Dockerfile.backend +++ b/docker/images/Dockerfile.backend @@ -7,7 +7,18 @@ WORKDIR /root RUN set -ex; \ apt-get -qq update; \ - apt-get -qqy --no-install-recommends install curl tzdata locales ca-certificates imagemagick webp fontconfig; \ + apt-get -qqy --no-install-recommends install \ + curl \ + tzdata \ + locales \ + ca-certificates \ + imagemagick \ + webp \ + fontconfig \ + woff-tools \ + woff2 \ + fontforge \ + ; \ echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen; \ locale-gen; \ rm -rf /var/lib/apt/lists/*; From e42e1e875162a62fae816a012d9575b4f7f53d75 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 16 Jun 2021 16:32:21 +0200 Subject: [PATCH 3/6] :bug: Properly preserve the font-family name on upload custom font. --- frontend/src/app/main/data/fonts.cljs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frontend/src/app/main/data/fonts.cljs b/frontend/src/app/main/data/fonts.cljs index 5acec3b8dc..41ca36c9ac 100644 --- a/frontend/src/app/main/data/fonts.cljs +++ b/frontend/src/app/main/data/fonts.cljs @@ -172,7 +172,7 @@ (uuid/next))] (update current-fonts id (fn [font] (-> font - (assoc :name name) + (assoc :font-family name) (assoc :font-id font-id)))))) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; From 44441ae9283b153acbd77dc5baee6331e55ba187 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 16 Jun 2021 16:49:15 +0200 Subject: [PATCH 4/6] :lipstick: Minor lint fix on emails ns. --- backend/src/app/emails.clj | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/src/app/emails.clj b/backend/src/app/emails.clj index 9033ca7145..ac55b688b9 100644 --- a/backend/src/app/emails.clj +++ b/backend/src/app/emails.clj @@ -127,9 +127,9 @@ (s/def :internal.emails.invite-to-team/token ::us/string) (s/def ::invite-to-team - (s/keys :keys [:internal.emails.invite-to-team/invited-by - :internal.emails.invite-to-team/token - :internal.emails.invite-to-team/team])) + (s/keys :req-un [:internal.emails.invite-to-team/invited-by + :internal.emails.invite-to-team/token + :internal.emails.invite-to-team/team])) (def invite-to-team "Teams member invitation email." From e08788190d27e69ab682cd5ae9febf73e07a1f5e Mon Sep 17 00:00:00 2001 From: "alonso.torres" Date: Wed, 16 Jun 2021 16:40:30 +0200 Subject: [PATCH 5/6] :bug: Fix problem with paths editing after flip --- CHANGES.md | 6 +++ common/app/common/geom/matrix.cljc | 10 +++-- common/app/common/geom/shapes/transforms.cljc | 15 ++++--- .../app/main/data/workspace/path/helpers.cljs | 41 ++++++++++++------- 4 files changed, 48 insertions(+), 24 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index d77a83c85d..21386a2cdc 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -11,6 +11,12 @@ ## 1.6.4-alpha +## 1.6.4-alpha + +### :bug: Bugs fixed + +- Fix problem with paths editing after flip [#1040](https://github.com/penpot/penpot/issues/1040) + ### :sparkles: Minor improvements - Decrease default bulk buffers on storage tasks. diff --git a/common/app/common/geom/matrix.cljc b/common/app/common/geom/matrix.cljc index 04aa8651d8..b24736dff9 100644 --- a/common/app/common/geom/matrix.cljc +++ b/common/app/common/geom/matrix.cljc @@ -135,7 +135,9 @@ (defmethod pp/simple-dispatch Matrix [obj] (pr obj)) (defn transform-in [pt mtx] - (-> (matrix) - (translate pt) - (multiply mtx) - (translate (gpt/negate pt)))) + (if (some? pt) + (-> (matrix) + (translate pt) + (multiply mtx) + (translate (gpt/negate pt))) + mtx)) diff --git a/common/app/common/geom/shapes/transforms.cljc b/common/app/common/geom/shapes/transforms.cljc index 5f57aaec38..e35e6536e2 100644 --- a/common/app/common/geom/shapes/transforms.cljc +++ b/common/app/common/geom/shapes/transforms.cljc @@ -304,21 +304,26 @@ :else (-> shape - (merge rect-shape)))] + (merge rect-shape))) + + base-rotation (or (:rotation shape) 0) + modif-rotation (or (get-in shape [:modifiers :rotation]) 0)] + (as-> shape $ (update $ :transform #(gmt/multiply (or % (gmt/matrix)) matrix)) (update $ :transform-inverse #(gmt/multiply matrix-inverse (or % (gmt/matrix)))) (assoc $ :points (into [] points)) (assoc $ :selrect (gpr/rect->selrect rect-shape)) - (update $ :rotation #(mod (+ (or % 0) - (or (get-in $ [:modifiers :rotation]) 0)) 360))))) + (assoc $ :rotation (mod (+ base-rotation modif-rotation) 360))))) (defn set-flip [shape modifiers] (let [rx (get-in modifiers [:resize-vector :x]) ry (get-in modifiers [:resize-vector :y])] (cond-> shape - (and rx (< rx 0)) (update :flip-x not) - (and ry (< ry 0)) (update :flip-y not)))) + (and rx (< rx 0)) (-> (update :flip-x not) + (update :rotation -)) + (and ry (< ry 0)) (-> (update :flip-y not) + (update :rotation -))))) (defn apply-displacement [shape] (let [modifiers (:modifiers shape)] diff --git a/frontend/src/app/main/data/workspace/path/helpers.cljs b/frontend/src/app/main/data/workspace/path/helpers.cljs index a1185b4218..cbf9d383ca 100644 --- a/frontend/src/app/main/data/workspace/path/helpers.cljs +++ b/frontend/src/app/main/data/workspace/path/helpers.cljs @@ -26,12 +26,31 @@ (= event :interrupt) ;; ESC (and (ms/mouse-double-click? event)))) +(defn content-center + [content] + (-> content + gsh/content->selrect + gsh/center-selrect)) + (defn content->points+selrect "Given the content of a shape, calculate its points and selrect" [shape content] - (let [transform (:transform shape (gmt/matrix)) - transform-inverse (:transform-inverse shape (gmt/matrix)) - center (gsh/center-shape shape) + + (let [{:keys [flip-x flip-y]} shape + transform + (cond-> (:transform shape (gmt/matrix)) + flip-x (gmt/scale (gpt/point -1 1)) + flip-y (gmt/scale (gpt/point 1 -1))) + + transform-inverse + (cond-> (gmt/matrix) + flip-x (gmt/scale (gpt/point -1 1)) + flip-y (gmt/scale (gpt/point 1 -1)) + :always (gmt/multiply (:transform-inverse shape (gmt/matrix)))) + + center (or (gsh/center-shape shape) + (content-center content)) + base-content (gsh/transform-content content (gmt/transform-in center transform-inverse)) @@ -39,30 +58,22 @@ ;; Calculates the new selrect with points given the old center points (-> (gsh/content->selrect base-content) (gsh/rect->points) - (gsh/transform-points center (:transform shape (gmt/matrix)))) + (gsh/transform-points center transform)) points-center (gsh/center-points points) ;; Points is now the selrect but the center is different so we can create the selrect ;; through points selrect (-> points - (gsh/transform-points points-center (:transform-inverse shape (gmt/matrix))) + (gsh/transform-points points-center transform-inverse) (gsh/points->selrect))] [points selrect])) (defn update-selrect "Updates the selrect and points for a path" [shape] - (if (= (:rotation shape 0) 0) - (let [content (:content shape) - selrect (gsh/content->selrect content) - points (gsh/rect->points selrect)] - (assoc shape :points points :selrect selrect)) - - (let [content (:content shape) - [points selrect] (content->points+selrect shape content)] - (assoc shape :points points :selrect selrect)))) - + (let [[points selrect] (content->points+selrect shape (:content shape))] + (assoc shape :points points :selrect selrect))) (defn closest-angle [angle] From beaea732769551e8acb4200bfb5ed9b9b2ca5781 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20Moya?= Date: Thu, 17 Jun 2021 13:59:46 +0200 Subject: [PATCH 6/6] :paperclip: Update version number. --- CHANGES.md | 6 +++--- version.txt | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 21386a2cdc..b74b8ab84b 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -9,14 +9,14 @@ ### :boom: Breaking changes ### :heart: Community contributions by (Thank you!) -## 1.6.4-alpha - -## 1.6.4-alpha +## 1.6.5-alpha ### :bug: Bugs fixed - Fix problem with paths editing after flip [#1040](https://github.com/penpot/penpot/issues/1040) +## 1.6.4-alpha + ### :sparkles: Minor improvements - Decrease default bulk buffers on storage tasks. diff --git a/version.txt b/version.txt index 0952b20357..48afc73f06 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -1.6.4-alpha +1.6.5-alpha