File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed
src/renderer/tool/impl/misc Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change 23
23
[db]
24
24
(tool.handlers/set-cursor db " crosshair" ))
25
25
26
- (defmethod tool.hierarchy / on-pointer-up : fill
27
- [db e ]
26
+ (defn fill
27
+ [db]
28
28
(let [color (document.handlers/attr db :fill )
29
- el-id (-> e :element :id )]
30
- (-> (element.handlers/set-attr db el-id :fill color)
29
+ el-id (-> db :clicked-element :id )]
30
+ (-> db
31
+ (dissoc :clicked-element )
32
+ (element.handlers/set-attr el-id :fill color)
31
33
(history.handlers/finalize #(t [::fill " Fill" ])))))
32
34
35
+ (defmethod tool.hierarchy /on-pointer-up :fill
36
+ [db _e]
37
+ (fill db))
38
+
39
+ (defmethod tool.hierarchy /on-drag-end :fill
40
+ [db _e]
41
+ (fill db))
42
+
33
43
(defmethod tool.hierarchy /on-pointer-move :fill
34
44
[db e]
35
45
(let [color (document.handlers/attr db :fill )
39
49
(element.handlers/set-attr (:id el) :fill color))))
40
50
41
51
(defmethod tool.hierarchy /on-pointer-down :fill
42
- [db _e]
43
- (history.handlers/reset-state db))
52
+ [db e]
53
+ (-> db
54
+ (assoc :clicked-element (-> e :element ))
55
+ (history.handlers/reset-state )))
You can’t perform that action at this time.
0 commit comments