File tree Expand file tree Collapse file tree 3 files changed +17
-14
lines changed
src/renderer/tool/impl/draw Expand file tree Collapse file tree 3 files changed +17
-14
lines changed Original file line number Diff line number Diff line change 6
6
[renderer.tool.handlers :as h]
7
7
[renderer.tool.hierarchy :as hierarchy]))
8
8
9
- (derive :brush ::hierarchy/element )
9
+ (derive :brush ::hierarchy/draw )
10
10
11
11
(defmethod hierarchy /properties :brush
12
12
[]
13
13
{:icon " brush" })
14
14
15
- (defmethod hierarchy /help [:brush :idle ]
16
- []
17
- " Click and drag to draw." )
18
-
19
- (defmethod hierarchy /activate :brush
20
- [db]
21
- (h/set-cursor db " none" ))
22
-
23
15
(defmethod hierarchy /pointer-move :brush
24
16
[db e]
25
17
(let [[x y] (:adjusted-pointer-pos db)
53
45
[db _e]
54
46
(-> db
55
47
(h/create-temp-element )
56
- (h/set-state :idle )
48
+ (h/activate :transform )
57
49
(h/explain " Draw line" )))
Original file line number Diff line number Diff line change 1
1
(ns renderer.tool.impl.draw.core
2
2
(:require
3
+ [renderer.tool.handlers :as h]
4
+ [renderer.tool.hierarchy :as hierarchy]
3
5
[renderer.tool.impl.draw.brush]
4
6
[renderer.tool.impl.draw.pen]))
7
+
8
+ (derive ::hierarchy/draw ::hierarchy/tool )
9
+
10
+ (defmethod hierarchy /help [::hierarchy/draw :idle ]
11
+ []
12
+ " Click and drag to draw." )
13
+
14
+ (defmethod hierarchy /activate ::hierarchy/draw
15
+ [db]
16
+ (h/set-cursor db " crosshair" ))
Original file line number Diff line number Diff line change 7
7
[renderer.utils.element :as element]
8
8
[renderer.utils.path :as path]))
9
9
10
- (derive :pen ::hierarchy/element )
10
+ (derive :pen ::hierarchy/draw )
11
11
12
12
(defmethod hierarchy /properties :pen
13
13
[]
14
- {:icon " pencil"
15
- :description " Pencil tool" })
14
+ {:icon " pencil" })
16
15
17
16
(defmethod hierarchy /drag :pen
18
17
[db]
35
34
(-> db
36
35
(h/set-temp path)
37
36
(h/create-temp-element )
38
- (h/set-state :idle )
37
+ (h/activate :transform )
39
38
(h/explain " Draw line" ))))
You can’t perform that action at this time.
0 commit comments