|
|
@@ -22,12 +22,14 @@ export default class BrushSession extends BaseSession {
|
|
22
|
22
|
this.origin = point
|
|
23
|
23
|
this.previous = point
|
|
24
|
24
|
this.last = point
|
|
25
|
|
- this.points = []
|
|
|
25
|
+ this.points = [[0, 0]]
|
|
26
|
26
|
this.snapshot = getDrawSnapshot(data, id)
|
|
27
|
27
|
|
|
28
|
28
|
const page = getPage(data)
|
|
29
|
|
- const shape = page.shapes[id]
|
|
|
29
|
+ const shape = page.shapes[id] as DrawShape
|
|
30
|
30
|
getShapeUtils(shape).translateTo(shape, point)
|
|
|
31
|
+
|
|
|
32
|
+ updateParents(data, [shape.id])
|
|
31
|
33
|
}
|
|
32
|
34
|
|
|
33
|
35
|
update = (
|
|
|
@@ -99,7 +101,12 @@ export default class BrushSession extends BaseSession {
|
|
99
|
101
|
const page = getPage(data)
|
|
100
|
102
|
const shape = page.shapes[snapshot.id] as DrawShape
|
|
101
|
103
|
|
|
102
|
|
- getShapeUtils(shape).onSessionComplete(shape)
|
|
|
104
|
+ getShapeUtils(shape)
|
|
|
105
|
+ .setProperty(shape, 'points', [...this.points])
|
|
|
106
|
+ .onSessionComplete(shape)
|
|
|
107
|
+
|
|
|
108
|
+ updateParents(data, [shape.id])
|
|
|
109
|
+
|
|
103
|
110
|
commands.draw(data, this.snapshot.id)
|
|
104
|
111
|
}
|
|
105
|
112
|
}
|