File tree Expand file tree Collapse file tree 3 files changed +14
-11
lines changed Expand file tree Collapse file tree 3 files changed +14
-11
lines changed Original file line number Diff line number Diff line change 40
40
[coll]
41
41
(str " [" (str/join " " (map #(.toFixed % 2 ) coll)) " ]" ))
42
42
43
+ (defn map->str
44
+ [m]
45
+ (interpose " , " (map (fn [[k v]]
46
+ ^{:key k}
47
+ [:span (str (name k) " : " (if (number? v)
48
+ (.toFixed v 2 )
49
+ (coll->str v)))]) m)))
50
+
43
51
(defn debug-rows
44
52
[]
45
- [[" Dom rect" @(rf/subscribe [::app.s/dom-rect ])]
53
+ [[" Dom rect" ( map->str @(rf/subscribe [::app.s/dom-rect ]) )]
46
54
[" Viewbox" (coll->str @(rf/subscribe [::frame.s/viewbox ]))]
47
55
[" Pointer position" (coll->str @(rf/subscribe [::app.s/pointer-pos ]))]
48
56
[" Adjusted pointer position" (coll->str @(rf/subscribe [::app.s/adjusted-pointer-pos ]))]
55
63
[" State" @(rf/subscribe [::tool.s/state ])]
56
64
[" Clicked element" (:id @(rf/subscribe [::app.s/clicked-element ]))]
57
65
[" Ignored elements" @(rf/subscribe [::document.s/ignored-ids ])]
58
- [" Snap" (into (map (fn [[k v]]
59
- ^{:key k}
60
- [:div (str (name k)
61
- " "
62
- (if (number? v)
63
- (.toFixed v 2 )
64
- (coll->str v)))]) @(rf/subscribe [::snap.s/nearest-neighbor ])))]])
66
+ [" Snap" (map->str @(rf/subscribe [::snap.s/nearest-neighbor ]))]])
65
67
66
68
(defn debug-info
67
69
[]
Original file line number Diff line number Diff line change 127
127
(dissoc :clicked-element )
128
128
(element.h/unignore :bounding-box )
129
129
(element.h/toggle-selection (:id element) (pointer/shift? e))
130
- (history.h/finalize (if (:selected element) " Deselect element" " Select element" ))))
130
+ (history.h/finalize (if (:selected element)
131
+ " Deselect element"
132
+ " Select element" ))))
131
133
132
134
(defmethod hierarchy /on-double-click :transform
133
135
[db e]
Original file line number Diff line number Diff line change 69
69
(let [factor (if (pointer/shift? e)
70
70
(:zoom-sensitivity db)
71
71
(/ 1 (:zoom-sensitivity db)))]
72
- (-> db
73
- (frame.h/zoom-at-pointer factor)
72
+ (-> (frame.h/zoom-at-pointer db factor)
74
73
(snap.h/update-viewport-tree )
75
74
(h/add-fx [::app.fx/persist ]))))
You can’t perform that action at this time.
0 commit comments