Skip to content

Commit 24f861f

Browse files
committed
fix(event): fix "unbind arcballCameraController event" bug: unbind should unbind cameraController's all binded functions
1 parent 05422f1 commit 24f861f

File tree

12 files changed

+315
-195
lines changed

12 files changed

+315
-195
lines changed

src/service/record/main/camera_controller/arcball/RecordArcballCameraControllerService.re

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ open StateDataMainType;
22

33
let create = () => {
44
index: 0,
5-
pointDragStartEventHandleFuncMap:
5+
pointDragStartEventHandleFuncListMap:
66
WonderCommonlib.MutableSparseMapService.createEmpty(),
7-
pointDragDropEventHandleFuncMap:
7+
pointDragDropEventHandleFuncListMap:
88
WonderCommonlib.MutableSparseMapService.createEmpty(),
9-
pointDragOverEventHandleFuncMap:
9+
pointDragOverEventHandleFuncListMap:
1010
WonderCommonlib.MutableSparseMapService.createEmpty(),
11-
pointScaleEventHandleFuncMap:
11+
pointScaleEventHandleFuncListMap:
1212
WonderCommonlib.MutableSparseMapService.createEmpty(),
13-
keydownEventHandleFuncMap:
13+
keydownEventHandleFuncListMap:
1414
WonderCommonlib.MutableSparseMapService.createEmpty(),
1515
dirtyArray: WonderCommonlib.ArrayService.createEmpty(),
1616
distanceMap: WonderCommonlib.MutableSparseMapService.createEmpty(),
@@ -31,11 +31,11 @@ let deepCopyForRestore =
3131
(
3232
{
3333
index,
34-
pointDragStartEventHandleFuncMap,
35-
pointDragDropEventHandleFuncMap,
36-
pointDragOverEventHandleFuncMap,
37-
pointScaleEventHandleFuncMap,
38-
keydownEventHandleFuncMap,
34+
pointDragStartEventHandleFuncListMap,
35+
pointDragDropEventHandleFuncListMap,
36+
pointDragOverEventHandleFuncListMap,
37+
pointScaleEventHandleFuncListMap,
38+
keydownEventHandleFuncListMap,
3939
dirtyArray,
4040
distanceMap,
4141
minDistanceMap,
@@ -52,17 +52,21 @@ let deepCopyForRestore =
5252
},
5353
) => {
5454
index,
55-
pointDragStartEventHandleFuncMap:
56-
pointDragStartEventHandleFuncMap |> WonderCommonlib.MutableSparseMapService.copy,
57-
pointDragDropEventHandleFuncMap:
58-
pointDragDropEventHandleFuncMap |> WonderCommonlib.MutableSparseMapService.copy,
59-
pointDragOverEventHandleFuncMap:
60-
pointDragOverEventHandleFuncMap |> WonderCommonlib.MutableSparseMapService.copy,
61-
pointScaleEventHandleFuncMap:
62-
pointScaleEventHandleFuncMap
55+
pointDragStartEventHandleFuncListMap:
56+
pointDragStartEventHandleFuncListMap
57+
|> WonderCommonlib.MutableSparseMapService.copy,
58+
pointDragDropEventHandleFuncListMap:
59+
pointDragDropEventHandleFuncListMap
60+
|> WonderCommonlib.MutableSparseMapService.copy,
61+
pointDragOverEventHandleFuncListMap:
62+
pointDragOverEventHandleFuncListMap
63+
|> WonderCommonlib.MutableSparseMapService.copy,
64+
pointScaleEventHandleFuncListMap:
65+
pointScaleEventHandleFuncListMap
66+
|> WonderCommonlib.MutableSparseMapService.copy,
67+
keydownEventHandleFuncListMap:
68+
keydownEventHandleFuncListMap
6369
|> WonderCommonlib.MutableSparseMapService.copy,
64-
keydownEventHandleFuncMap:
65-
keydownEventHandleFuncMap |> WonderCommonlib.MutableSparseMapService.copy,
6670
dirtyArray: dirtyArray |> Js.Array.copy,
6771
distanceMap: distanceMap |> WonderCommonlib.MutableSparseMapService.copy,
6872
minDistanceMap:

src/service/state/main/camera_controller/arcball/DisposeArcballCameraControllerMainService.re

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ let _disposeData = (cameraController, state) => {
1010
|> EventArcballCameraControllerMainService.unbindEvent(cameraController);
1111

1212
let {
13-
pointDragOverEventHandleFuncMap,
14-
pointScaleEventHandleFuncMap,
15-
keydownEventHandleFuncMap,
1613
dirtyArray,
1714
distanceMap,
1815
minDistanceMap,

0 commit comments

Comments
 (0)