🐛 Fix problem editing rotated texts

This commit is contained in:
alonso.torres 2022-09-01 12:44:33 +02:00
parent d6317297d7
commit 04d6e76c6c
4 changed files with 43 additions and 25 deletions

View file

@ -17,16 +17,22 @@
:width width
:height height})
(defn position-data-points
[{:keys [position-data] :as shape}]
(let [points (->> position-data
(mapcat (comp gpr/rect->points position-data->rect)))
transform (gtr/transform-matrix shape)]
(gco/transform-points points transform)))
(defn position-data-selrect
[shape]
(let [points (->> shape
:position-data
(mapcat (comp gpr/rect->points position-data->rect)))]
(-> points (gpr/points->selrect))))
(defn position-data-bounding-box
[shape]
(gpr/points->selrect (position-data-points shape)))
(let [points (->> shape
:position-data
(mapcat (comp gpr/rect->points position-data->rect)))
transform (gtr/transform-matrix shape)]
(-> points
(gco/transform-points transform)
(gpr/points->selrect ))))
(defn overlaps-position-data?
"Checks if the given position data is inside the shape"