Compare commits

..

7 Commits

Author SHA1 Message Date
Andrés Moya
beaea73276 📎 Update version number. 2021-06-17 14:00:24 +02:00
Andrés Moya
50e0284084 Merge pull request #1043 from penpot/fix/problem-with-flip-transforms
🐛 Fix problem with paths editing after flip
2021-06-16 17:11:02 +02:00
alonso.torres
e08788190d 🐛 Fix problem with paths editing after flip 2021-06-16 17:05:18 +02:00
Andrey Antukh
44441ae928 💄 Minor lint fix on emails ns. 2021-06-16 16:49:15 +02:00
Andrey Antukh
e42e1e8751 🐛 Properly preserve the font-family name on upload custom font. 2021-06-16 16:32:21 +02:00
Andrey Antukh
ae4b743ea4 🐛 Add missing system deps to the default docker backend image. 2021-06-16 16:14:44 +02:00
Andrey Antukh
782e060448 📎 Add minior adaptations to main docker files. 2021-06-07 11:03:53 +02:00
9 changed files with 68 additions and 33 deletions

View File

@@ -9,6 +9,12 @@
### :boom: Breaking changes
### :heart: Community contributions by (Thank you!)
## 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

View File

@@ -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."

View File

@@ -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))

View File

@@ -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)]

View File

@@ -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/*;
@@ -40,6 +51,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"]

View File

@@ -1,7 +1,7 @@
FROM nginx:latest
LABEL maintainer="Andrey Antukh <niwi@niwi.nz>"
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

View File

@@ -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))))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

View File

@@ -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]

View File

@@ -1 +1 @@
1.6.4-alpha
1.6.5-alpha