mirror of
https://github.com/penpot/penpot.git
synced 2025-05-29 07:06:11 +02:00
✨ Add naming improvement to bool content update fn
This commit is contained in:
parent
1fc0203c38
commit
09c3490cae
6 changed files with 9 additions and 12 deletions
|
@ -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}
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue