Skip to content

Commit

Permalink
remove fill from dropped strings
Browse files Browse the repository at this point in the history
  • Loading branch information
sprocketc committed Feb 2, 2024
1 parent 1797c20 commit 5d0ee0e
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions src/renderer/handlers.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,17 @@

(defn drop-items
"https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem"
[{:keys [adjusted-pointer-pos active-document] :as db} items]
(let [fill (get-in db [:documents active-document :fill])]
(doall
(for [item items]
(case (.-kind item)
"string" (.getAsString
item
#(rf/dispatch [:element/add
{:type :element
:tag :text
:content %
:attrs {:x (first adjusted-pointer-pos)
:y (second adjusted-pointer-pos)
:fill fill}}]))
nil))))
[{:keys [adjusted-pointer-pos] :as db} items]
(doall
(for [item items]
(case (.-kind item)
"string" (.getAsString
item
#(rf/dispatch [:element/add
{:type :element
:tag :text
:content %
:attrs {:x (first adjusted-pointer-pos)
:y (second adjusted-pointer-pos)}}]))
nil)))
db)

0 comments on commit 5d0ee0e

Please sign in to comment.