Skip to content

Commit 95504fc

Browse files
committed
chore: Disable the workspace cursor.
1 parent 6869679 commit 95504fc

File tree

1 file changed

+4
-25
lines changed

1 file changed

+4
-25
lines changed

src/actions/ws_movement.ts

Lines changed: 4 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66

7-
import {ASTNode, ShortcutRegistry, utils as BlocklyUtils} from 'blockly';
7+
import {ShortcutRegistry, utils as BlocklyUtils} from 'blockly';
88
import * as Constants from '../constants';
99
import type {WorkspaceSvg} from 'blockly';
1010
import {Navigation} from 'src/navigation';
@@ -103,24 +103,7 @@ export class WorkspaceMovement {
103103
xDirection: number,
104104
yDirection: number,
105105
): boolean {
106-
const cursor = workspace.getCursor();
107-
if (!cursor) return false;
108-
const curNode = cursor?.getCurNode();
109-
if (!curNode || curNode.getType() !== ASTNode.types.WORKSPACE) return false;
110-
111-
const wsCoord = curNode.getWsCoordinate();
112-
if (!wsCoord) return false;
113-
114-
const newX = xDirection * WS_MOVE_DISTANCE + wsCoord.x;
115-
const newY = yDirection * WS_MOVE_DISTANCE + wsCoord.y;
116-
117-
cursor.setCurNode(
118-
ASTNode.createWorkspaceNode(
119-
workspace,
120-
new BlocklyUtils.Coordinate(newX, newY),
121-
),
122-
);
123-
return true;
106+
return false;
124107
}
125108

126109
/**
@@ -129,15 +112,11 @@ export class WorkspaceMovement {
129112
* @param workspace The workspace the cursor is on.
130113
*/
131114
createWSCursor(workspace: WorkspaceSvg) {
132-
const workspaceNode = ASTNode.createWorkspaceNode(
133-
workspace,
134-
new BlocklyUtils.Coordinate(10, 10),
135-
);
136115
const cursor = workspace.getCursor();
137116

138-
if (!cursor || !workspaceNode) return false;
117+
if (!cursor) return false;
139118

140-
cursor.setCurNode(workspaceNode);
119+
cursor.setCurNode(workspace);
141120
return true;
142121
}
143122
}

0 commit comments

Comments
 (0)