mirror of
https://github.com/penpot/penpot.git
synced 2025-08-03 19:28:27 +02:00
🐛 Fix inconsistent representation of rectangles
This commit is contained in:
parent
5c5ec8ef56
commit
7f7032aaa5
6 changed files with 45 additions and 16 deletions
|
@ -224,7 +224,11 @@
|
|||
#_:else (rect->path shape))
|
||||
|
||||
;; Apply the transforms that had the shape
|
||||
transform (:transform shape)
|
||||
transform
|
||||
(cond-> (:transform shape (gmt/matrix))
|
||||
(:flip-x shape) (gmt/scale (gpt/point -1 1))
|
||||
(:flip-y shape) (gmt/scale (gpt/point 1 -1)))
|
||||
|
||||
new-content (cond-> new-content
|
||||
(some? transform)
|
||||
(gsp/transform-content (gmt/transform-in (gsc/center-shape shape) transform)))]
|
||||
|
|
|
@ -87,11 +87,17 @@
|
|||
|
||||
(defn set-radius-4
|
||||
[shape attr value]
|
||||
(cond-> shape
|
||||
(:rx shape)
|
||||
(-> (dissoc :rx :rx)
|
||||
(assoc :r1 0 :r2 0 :r3 0 :r4 0))
|
||||
(let [attr (cond->> attr
|
||||
(:flip-x shape)
|
||||
(get {:r1 :r2 :r2 :r1 :r3 :r4 :r4 :r3})
|
||||
|
||||
:always
|
||||
(assoc attr value)))
|
||||
(:flip-y shape)
|
||||
(get {:r1 :r4 :r2 :r3 :r3 :r2 :r4 :r1}))]
|
||||
|
||||
(cond-> shape
|
||||
(:rx shape)
|
||||
(-> (dissoc :rx :rx)
|
||||
(assoc :r1 0 :r2 0 :r3 0 :r4 0))
|
||||
|
||||
:always
|
||||
(assoc attr value))))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue