|
|
@@ -1,9 +1,9 @@
|
|
1
|
|
-import { current } from "immer"
|
|
2
|
|
-import { Bounds, Data } from "types"
|
|
3
|
|
-import BaseSession from "./base-session"
|
|
4
|
|
-import { getShapeUtils } from "lib/shape-utils"
|
|
5
|
|
-import { getBoundsFromPoints, getShapes } from "utils/utils"
|
|
6
|
|
-import * as vec from "utils/vec"
|
|
|
1
|
+import { current } from 'immer'
|
|
|
2
|
+import { Bounds, Data } from 'types'
|
|
|
3
|
+import BaseSession from './base-session'
|
|
|
4
|
+import { getShapeUtils } from 'lib/shape-utils'
|
|
|
5
|
+import { getBoundsFromPoints, getShapes } from 'utils/utils'
|
|
|
6
|
+import * as vec from 'utils/vec'
|
|
7
|
7
|
|
|
8
|
8
|
export default class BrushSession extends BaseSession {
|
|
9
|
9
|
origin: number[]
|
|
|
@@ -25,7 +25,9 @@ export default class BrushSession extends BaseSession {
|
|
25
|
25
|
for (let id in snapshot.shapeHitTests) {
|
|
26
|
26
|
const test = snapshot.shapeHitTests[id]
|
|
27
|
27
|
if (test(brushBounds)) {
|
|
28
|
|
- data.selectedIds.add(id)
|
|
|
28
|
+ if (!data.selectedIds.has(id)) {
|
|
|
29
|
+ data.selectedIds.add(id)
|
|
|
30
|
+ }
|
|
29
|
31
|
} else if (data.selectedIds.has(id)) {
|
|
30
|
32
|
data.selectedIds.delete(id)
|
|
31
|
33
|
}
|