mirror of
https://github.com/penpot/penpot.git
synced 2025-01-08 07:50:43 -05:00
🐛 Fix problem with texts in viewer
This commit is contained in:
parent
3d381b92d9
commit
baf9124304
1 changed files with 10 additions and 5 deletions
|
@ -43,11 +43,12 @@
|
|||
(defn move-position-data
|
||||
[position-data dx dy]
|
||||
|
||||
(cond->> position-data
|
||||
(d/num? dx dy)
|
||||
(mapv #(-> %
|
||||
(update :x + dx)
|
||||
(update :y + dy)))))
|
||||
(when (some? position-data)
|
||||
(cond->> position-data
|
||||
(d/num? dx dy)
|
||||
(mapv #(-> %
|
||||
(update :x + dx)
|
||||
(update :y + dy))))))
|
||||
|
||||
(defn move
|
||||
"Move the shape relatively to its current
|
||||
|
@ -284,6 +285,8 @@
|
|||
[shape transform-mtx]
|
||||
(let [bool? (= (:type shape) :bool)
|
||||
path? (= (:type shape) :path)
|
||||
text? (= (:type shape) :text)
|
||||
{dx :x dy :y} (gpt/transform (gpt/point) transform-mtx)
|
||||
points (gco/transform-points (:points shape) transform-mtx)
|
||||
selrect (gco/transform-selrect (:selrect shape) transform-mtx)]
|
||||
(-> shape
|
||||
|
@ -291,6 +294,8 @@
|
|||
(update :bool-content gpa/transform-content transform-mtx))
|
||||
(cond-> path?
|
||||
(update :content gpa/transform-content transform-mtx))
|
||||
(cond-> text?
|
||||
(update :position-data move-position-data dx dy))
|
||||
(cond-> (not path?)
|
||||
(assoc :x (:x selrect)
|
||||
:y (:y selrect)
|
||||
|
|
Loading…
Reference in a new issue