diff --git a/common/src/app/common/files/builder.cljc b/common/src/app/common/files/builder.cljc index 071fd31d9..b23326710 100644 --- a/common/src/app/common/files/builder.cljc +++ b/common/src/app/common/files/builder.cljc @@ -21,7 +21,6 @@ [app.common.types.file :as ctf] [app.common.types.page :as ctp] [app.common.types.pages-list :as ctpl] - [app.common.types.path :as path] [app.common.types.shape :as cts] [app.common.uuid :as uuid] [cuerdas.core :as str])) @@ -273,15 +272,13 @@ :else (let [objects (lookup-objects file) - ;; FIXME: this makes a duplicate operation - content (path/calc-bool-content bool objects) - bool' (gsh/update-bool-selrect bool children objects)] + bool' (gsh/update-bool bool children objects)] (commit-change file {:type :mod-obj :id bool-id :operations - [{:type :set :attr :content :val content :ignore-touched true} + [{:type :set :attr :content :val (:content bool') :ignore-touched true} {:type :set :attr :selrect :val (:selrect bool') :ignore-touched true} {:type :set :attr :points :val (:points bool') :ignore-touched true} {:type :set :attr :x :val (-> bool' :selrect :x) :ignore-touched true} diff --git a/common/src/app/common/files/changes.cljc b/common/src/app/common/files/changes.cljc index 023491a9c..61b08e6b0 100644 --- a/common/src/app/common/files/changes.cljc +++ b/common/src/app/common/files/changes.cljc @@ -739,7 +739,7 @@ group (= :bool (:type group)) - (gsh/update-bool-selrect group children objects) + (gsh/update-bool group children objects) (:masked-group group) (set-mask-selrect group children) diff --git a/common/src/app/common/files/changes_builder.cljc b/common/src/app/common/files/changes_builder.cljc index e1df708d6..9028c04d9 100644 --- a/common/src/app/common/files/changes_builder.cljc +++ b/common/src/app/common/files/changes_builder.cljc @@ -660,7 +660,7 @@ nil ;; so it does not need resize (= (:type parent) :bool) - (gsh/update-bool-selrect parent children objects) + (gsh/update-bool parent children objects) (= (:type parent) :group) (if (:masked-group parent) diff --git a/common/src/app/common/geom/shapes.cljc b/common/src/app/common/geom/shapes.cljc index d03583cfd..1710302c3 100644 --- a/common/src/app/common/geom/shapes.cljc +++ b/common/src/app/common/geom/shapes.cljc @@ -164,7 +164,7 @@ (dm/export gtr/calculate-geometry) (dm/export gtr/update-group-selrect) (dm/export gtr/update-mask-selrect) -(dm/export gtr/update-bool-selrect) +(dm/export gtr/update-bool) (dm/export gtr/apply-transform) (dm/export gtr/transform-shape) (dm/export gtr/transform-selrect) diff --git a/common/src/app/common/geom/shapes/transforms.cljc b/common/src/app/common/geom/shapes/transforms.cljc index 24f579a5b..7af176b2a 100644 --- a/common/src/app/common/geom/shapes/transforms.cljc +++ b/common/src/app/common/geom/shapes/transforms.cljc @@ -447,7 +447,7 @@ (assoc :flip-x (-> mask :flip-x)) (assoc :flip-y (-> mask :flip-y))))) -(defn update-bool-selrect +(defn update-bool "Calculates the selrect+points for the boolean shape" [shape _children objects] @@ -468,7 +468,7 @@ (update-mask-selrect shape children) (cfh/bool-shape? shape) - (update-bool-selrect shape children objects) + (update-bool shape children objects) (cfh/group-shape? shape) (update-group-selrect shape children) diff --git a/frontend/src/app/main/data/workspace/bool.cljs b/frontend/src/app/main/data/workspace/bool.cljs index f5b9c5330..858239b75 100644 --- a/frontend/src/app/main/data/workspace/bool.cljs +++ b/frontend/src/app/main/data/workspace/bool.cljs @@ -54,7 +54,7 @@ (-> shape (merge (select-keys head bool/style-properties)) (cts/setup-shape) - (gsh/update-bool-selrect shapes objects))] + (gsh/update-bool shapes objects))] [shape (cph/get-position-on-parent objects (:id head))])) @@ -120,7 +120,7 @@ (assoc :type :bool) (assoc :bool-type type) (merge head-data) - (gsh/update-bool-selrect shapes objects)))) + (gsh/update-bool shapes objects)))) (defn group-to-bool [shape-id type]