🐛 Fix object alignment issue

This commit is contained in:
Andrey Antukh
2023-07-14 15:35:33 +02:00
committed by Alonso Torres
parent e78edca5a8
commit a3f347c9fd
+4 -3
View File
@@ -6,6 +6,7 @@
(ns app.common.geom.align
(:require
[app.common.geom.point :as gpt]
[app.common.geom.rect :as grc]
[app.common.geom.shapes :as gsh]
[app.common.pages.helpers :refer [get-children]]))
@@ -32,9 +33,9 @@
move also all of its recursive children."
[shape rect axis objects]
(let [wrapper-rect (gsh/shapes->rect [shape])
align-pos (calc-align-pos wrapper-rect rect axis)
delta {:x (- (:x align-pos) (:x wrapper-rect))
:y (- (:y align-pos) (:y wrapper-rect))}]
align-pos (calc-align-pos wrapper-rect rect axis)
delta (gpt/point (- (:x align-pos) (:x wrapper-rect))
(- (:y align-pos) (:y wrapper-rect)))]
(recursive-move shape delta objects)))
(defn calc-align-pos