File tree 1 file changed +16
-0
lines changed
1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 42
42
(assoc :cursor " crosshair" )
43
43
(h/set-message [:div " Click and drag to draw." ])))
44
44
45
+ (defmethod tool /deactivate :measure
46
+ [db]
47
+ (element.h/clear-temp db))
48
+
45
49
(defonce options
46
50
[::size ::thinning ::smoothing ::streamline ])
47
51
82
86
[]
83
87
" How much to streamline the stroke." )
84
88
89
+ (defmethod tool /pointer-move :brush
90
+ [{:keys [adjusted-pointer-pos] :as db} {:keys [pressure]}]
91
+ (let [[x y] adjusted-pointer-pos
92
+ r (* (/ 16 2 ) (if (zero? pressure) 1 pressure))
93
+ stroke (get-in db [:documents (:active-document db) :stroke ])]
94
+ (element.h/set-temp db {:type :element
95
+ :tag :circle
96
+ :attrs {:cx x
97
+ :cy y
98
+ :r r
99
+ :fill stroke}})))
100
+
85
101
(defmethod tool /drag :brush
86
102
[{:keys [active-document
87
103
adjusted-pointer-pos] :as db} {:keys [pressure]}]
You can’t perform that action at this time.
0 commit comments