Skip to content

Commit

Permalink
fix create element position
Browse files Browse the repository at this point in the history
  • Loading branch information
sprocketc committed Dec 7, 2023
1 parent 8e633eb commit 320ba67
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/renderer/element/handlers.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -435,8 +435,7 @@
(let [key (uuid/generate)
parent (or (:parent el)
(if (page? el) :canvas (-> db active-page :key)))
el (map/deep-merge el default-props {:key key :parent parent})
[x1 y1 _ _] (tools/bounds (active-page db))]
el (map/deep-merge el default-props {:key key :parent parent})]
(cond-> db
:always
(-> (assoc-in (conj (path db) key) el)
Expand All @@ -445,9 +444,6 @@
(not= (:tool db) :select)
(tools/set-tool :select)

(not (page? el))
(translate [(- x1) (- y1)])

(page? el)
(set-active-page key))))

Expand Down

0 comments on commit 320ba67

Please sign in to comment.