Skip to content

Commit

Permalink
fix(event): fix "unbind arcballCameraController event" bug: unbind sh…
Browse files Browse the repository at this point in the history
…ould unbind cameraController's all binded functions
  • Loading branch information
yyc-git committed May 9, 2019
1 parent 05422f1 commit 24f861f
Show file tree
Hide file tree
Showing 12 changed files with 315 additions and 195 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ open StateDataMainType;

let create = () => {
index: 0,
pointDragStartEventHandleFuncMap:
pointDragStartEventHandleFuncListMap:
WonderCommonlib.MutableSparseMapService.createEmpty(),
pointDragDropEventHandleFuncMap:
pointDragDropEventHandleFuncListMap:
WonderCommonlib.MutableSparseMapService.createEmpty(),
pointDragOverEventHandleFuncMap:
pointDragOverEventHandleFuncListMap:
WonderCommonlib.MutableSparseMapService.createEmpty(),
pointScaleEventHandleFuncMap:
pointScaleEventHandleFuncListMap:
WonderCommonlib.MutableSparseMapService.createEmpty(),
keydownEventHandleFuncMap:
keydownEventHandleFuncListMap:
WonderCommonlib.MutableSparseMapService.createEmpty(),
dirtyArray: WonderCommonlib.ArrayService.createEmpty(),
distanceMap: WonderCommonlib.MutableSparseMapService.createEmpty(),
Expand All @@ -31,11 +31,11 @@ let deepCopyForRestore =
(
{
index,
pointDragStartEventHandleFuncMap,
pointDragDropEventHandleFuncMap,
pointDragOverEventHandleFuncMap,
pointScaleEventHandleFuncMap,
keydownEventHandleFuncMap,
pointDragStartEventHandleFuncListMap,
pointDragDropEventHandleFuncListMap,
pointDragOverEventHandleFuncListMap,
pointScaleEventHandleFuncListMap,
keydownEventHandleFuncListMap,
dirtyArray,
distanceMap,
minDistanceMap,
Expand All @@ -52,17 +52,21 @@ let deepCopyForRestore =
},
) => {
index,
pointDragStartEventHandleFuncMap:
pointDragStartEventHandleFuncMap |> WonderCommonlib.MutableSparseMapService.copy,
pointDragDropEventHandleFuncMap:
pointDragDropEventHandleFuncMap |> WonderCommonlib.MutableSparseMapService.copy,
pointDragOverEventHandleFuncMap:
pointDragOverEventHandleFuncMap |> WonderCommonlib.MutableSparseMapService.copy,
pointScaleEventHandleFuncMap:
pointScaleEventHandleFuncMap
pointDragStartEventHandleFuncListMap:
pointDragStartEventHandleFuncListMap
|> WonderCommonlib.MutableSparseMapService.copy,
pointDragDropEventHandleFuncListMap:
pointDragDropEventHandleFuncListMap
|> WonderCommonlib.MutableSparseMapService.copy,
pointDragOverEventHandleFuncListMap:
pointDragOverEventHandleFuncListMap
|> WonderCommonlib.MutableSparseMapService.copy,
pointScaleEventHandleFuncListMap:
pointScaleEventHandleFuncListMap
|> WonderCommonlib.MutableSparseMapService.copy,
keydownEventHandleFuncListMap:
keydownEventHandleFuncListMap
|> WonderCommonlib.MutableSparseMapService.copy,
keydownEventHandleFuncMap:
keydownEventHandleFuncMap |> WonderCommonlib.MutableSparseMapService.copy,
dirtyArray: dirtyArray |> Js.Array.copy,
distanceMap: distanceMap |> WonderCommonlib.MutableSparseMapService.copy,
minDistanceMap:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ let _disposeData = (cameraController, state) => {
|> EventArcballCameraControllerMainService.unbindEvent(cameraController);

let {
pointDragOverEventHandleFuncMap,
pointScaleEventHandleFuncMap,
keydownEventHandleFuncMap,
dirtyArray,
distanceMap,
minDistanceMap,
Expand Down
Loading

0 comments on commit 24f861f

Please sign in to comment.