Skip to content
Permalink
Browse files

feat(header): fix "NewScene": should clear current scene tree node be…

…fore exec update_transform_gizmos job
  • Loading branch information...
yyc-git committed May 30, 2019
1 parent 79e3d37 commit b65da2ff5e696e91a34d5382e1ac506316a6db0e
@@ -75,6 +75,11 @@ let handleNewScene = (dispatchFunc, (editorState, engineState)) => {
),
);

editorState
|> SceneTreeSelectCurrentNodeUtils.clearCurrentData
|> StateEditorService.setState
|> ignore;

let engineState =
engineState |> StateLogicService.renderEngineStateAndReturnEngineState;

@@ -85,5 +90,5 @@ let handleNewScene = (dispatchFunc, (editorState, engineState)) => {
)
|> ignore;

(editorState, engineState);
(StateEditorService.getState(), engineState);
};
@@ -84,6 +84,7 @@ let _ =
)
|> expect == true;
});

describe("update active basic camera view", () => {
let _prepare = sandbox => {
let _ =
@@ -128,4 +129,43 @@ let _ =
|> expect !== activedBasicCameraViewBefore;
});
});

test(
"should clear current scene tree node before exec update_transform_gizmos job",
() => {
MainEditorSceneTool.initStateWithJob(
~sandbox,
~isBuildFakeDom=false,
~noWorkerJobRecord=
NoWorkerJobConfigToolEngine.buildNoWorkerJobConfig(
~loopPipelines=
{|
[
{
"name": "default",
"jobs": [
{
"name": "dispose"
},
{
"name": "update_transform_gizmos"
}
]
}
]
|},
(),
),
(),
);
MainEditorSceneTool.createDefaultSceneAndNotInit(sandbox);
StateLogicService.getAndSetEngineState(MainUtils._handleEngineState);
MainEditorSceneTool.setFirstCubeToBeCurrentSceneTreeNode();
TestTool.openContractCheck();

let (editorState, engineState) = _handleNewScene();
editorState |> StateEditorService.setState |> ignore;

GameObjectTool.getCurrentSceneTreeNode() |> expect == None;
});
});

0 comments on commit b65da2f

Please sign in to comment.
You can’t perform that action at this time.