File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 4242 (assoc :cursor " crosshair" )
4343 (h/set-message [:div " Click and drag to draw." ])))
4444
45+ (defmethod tool /deactivate :measure
46+ [db]
47+ (element.h/clear-temp db))
48+
4549(defonce options
4650 [::size ::thinning ::smoothing ::streamline ])
4751
8286 []
8387 " How much to streamline the stroke." )
8488
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+
85101(defmethod tool /drag :brush
86102 [{:keys [active-document
87103 adjusted-pointer-pos] :as db} {:keys [pressure]}]
You can’t perform that action at this time.
0 commit comments