File tree 3 files changed +12
-7
lines changed
3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change 14
14
[renderer.history.handlers :as history.h]
15
15
[renderer.notification.handlers :as notification.h]
16
16
[renderer.notification.views :as notification.v]
17
+ [renderer.snap.handlers :as snap.h]
17
18
[renderer.utils.compatibility :as compatibility]
18
19
[renderer.utils.dom :as dom]
19
20
[renderer.utils.system :as system]
150
151
::init
151
152
[(rf/inject-cofx ::app.fx/guid )]
152
153
(fn [{:keys [db guid]} [_]]
153
- {:db (cond-> db
154
- (not ( :active-document db) )
155
- (-> (create guid)
154
+ {:db (if ( :active-document db)
155
+ (snap.h/rebuild-tree db)
156
+ (-> (create db guid)
156
157
(history.h/finalize " Init document" )))}))
157
158
158
159
(rf/reg-event-fx
Original file line number Diff line number Diff line change 82
82
(-> db :window :focused )
83
83
(not (get-in db (path db :focused ))))
84
84
(-> (frame.h/focus-bounds :original )
85
- (assoc-in (path db :focused ) true ))))
85
+ (assoc-in (path db :focused ) true )
86
+ (snap.h/update-viewbox-tree ))))
86
87
87
88
(m/=> search-by-path [:-> App string? [:maybe uuid?]])
88
89
(defn search-by-path
Original file line number Diff line number Diff line change 6
6
[renderer.app.events]
7
7
[renderer.document.events :as-alias document.e]
8
8
[renderer.element.handlers :as element.h]
9
- [renderer.frame.handlers :as h]))
9
+ [renderer.frame.handlers :as h]
10
+ [renderer.snap.handlers :as snap.h]))
10
11
11
12
(rf/reg-event-db
12
13
::resize
13
14
[persist]
14
15
(fn [db [_ dom-rect]]
15
16
(-> db
16
17
(h/recenter-to-dom-rect dom-rect)
17
- (assoc :dom-rect dom-rect))))
18
+ (assoc :dom-rect dom-rect)
19
+ (snap.h/update-viewbox-tree ))))
18
20
19
21
(rf/reg-event-db
20
22
::focus-selection
21
23
[persist]
22
24
(fn [db [_ focus-type]]
23
- (h/focus-bounds db focus-type)))
25
+ (-> (h/focus-bounds db focus-type)
26
+ (snap.h/update-viewbox-tree ))))
24
27
25
28
(rf/reg-event-db
26
29
::set-zoom
You can’t perform that action at this time.
0 commit comments