|
|
@@ -58,7 +58,8 @@ const state = createState({
|
|
58
|
58
|
on: {
|
|
59
|
59
|
UNDO: { do: "undo" },
|
|
60
|
60
|
REDO: { do: "redo" },
|
|
61
|
|
- DELETED: { do: "deleteSelection" },
|
|
|
61
|
+ CANCELLED: { do: "clearSelectedIds" },
|
|
|
62
|
+ DELETED: { do: "deleteSelectedIds" },
|
|
62
|
63
|
GENERATED_SHAPES_FROM_CODE: "setGeneratedShapes",
|
|
63
|
64
|
INCREASED_CODE_FONT_SIZE: "increaseCodeFontSize",
|
|
64
|
65
|
DECREASED_CODE_FONT_SIZE: "decreaseCodeFontSize",
|
|
|
@@ -171,7 +172,7 @@ const state = createState({
|
|
171
|
172
|
PANNED_CAMERA: "updateTranslateSession",
|
|
172
|
173
|
STOPPED_POINTING: { do: "completeSession", to: "selecting" },
|
|
173
|
174
|
CANCELLED: {
|
|
174
|
|
- do: ["cancelSession", "deleteSelection"],
|
|
|
175
|
+ do: ["cancelSession", "deleteSelectedIds"],
|
|
175
|
176
|
to: "selecting",
|
|
176
|
177
|
},
|
|
177
|
178
|
},
|
|
|
@@ -221,9 +222,7 @@ const state = createState({
|
|
221
|
222
|
point: screenToWorld(payload.point, data),
|
|
222
|
223
|
})
|
|
223
|
224
|
|
|
224
|
|
- data.selectedIds.clear()
|
|
225
|
|
- data.selectedIds.add(shape.id)
|
|
226
|
|
- data.document.pages[data.currentPageId].shapes[shape.id] = shape
|
|
|
225
|
+ commands.createShape(data, shape)
|
|
227
|
226
|
},
|
|
228
|
227
|
|
|
229
|
228
|
// History
|
|
|
@@ -299,7 +298,7 @@ const state = createState({
|
|
299
|
298
|
},
|
|
300
|
299
|
|
|
301
|
300
|
// Selection
|
|
302
|
|
- deleteSelection(data) {
|
|
|
301
|
+ deleteSelectedIds(data) {
|
|
303
|
302
|
const { document, currentPageId } = data
|
|
304
|
303
|
const shapes = document.pages[currentPageId].shapes
|
|
305
|
304
|
|
|
|
@@ -312,7 +311,6 @@ const state = createState({
|
|
312
|
311
|
data.hoveredId = undefined
|
|
313
|
312
|
data.pointedId = undefined
|
|
314
|
313
|
},
|
|
315
|
|
-
|
|
316
|
314
|
setHoveredId(data, payload: PointerInfo) {
|
|
317
|
315
|
data.hoveredId = payload.target
|
|
318
|
316
|
},
|