|
14 | 14 | */ |
15 | 15 |
|
16 | 16 | import {BlockSvg} from '../block_svg.js'; |
17 | | -import {CommentBarButton} from '../comments/comment_bar_button.js'; |
18 | 17 | import {RenderedWorkspaceComment} from '../comments/rendered_workspace_comment.js'; |
19 | | -import {Field} from '../field.js'; |
20 | 18 | import {getFocusManager} from '../focus_manager.js'; |
21 | 19 | import type {IFocusableNode} from '../interfaces/i_focusable_node.js'; |
22 | 20 | import * as registry from '../registry.js'; |
23 | | -import {Rect} from '../utils/rect.js'; |
24 | | -import {WorkspaceSvg} from '../workspace_svg.js'; |
| 21 | +import type {WorkspaceSvg} from '../workspace_svg.js'; |
25 | 22 | import {Marker} from './marker.js'; |
26 | 23 |
|
27 | 24 | /** |
@@ -392,31 +389,6 @@ export class LineCursor extends Marker { |
392 | 389 | */ |
393 | 390 | setCurNode(newNode: IFocusableNode) { |
394 | 391 | getFocusManager().focusNode(newNode); |
395 | | - |
396 | | - // Try to scroll cursor into view. |
397 | | - if (newNode instanceof BlockSvg) { |
398 | | - newNode.workspace.scrollBoundsIntoView( |
399 | | - newNode.getBoundingRectangleWithoutChildren(), |
400 | | - ); |
401 | | - } else if (newNode instanceof Field) { |
402 | | - const block = newNode.getSourceBlock() as BlockSvg; |
403 | | - block.workspace.scrollBoundsIntoView( |
404 | | - block.getBoundingRectangleWithoutChildren(), |
405 | | - ); |
406 | | - } else if (newNode instanceof RenderedWorkspaceComment) { |
407 | | - newNode.workspace.scrollBoundsIntoView(newNode.getBoundingRectangle()); |
408 | | - } else if (newNode instanceof CommentBarButton) { |
409 | | - const commentView = newNode.getCommentView(); |
410 | | - const xy = commentView.getRelativeToSurfaceXY(); |
411 | | - const size = commentView.getSize(); |
412 | | - const bounds = new Rect( |
413 | | - xy.y, |
414 | | - xy.y + size.height, |
415 | | - xy.x, |
416 | | - xy.x + size.width, |
417 | | - ); |
418 | | - commentView.workspace.scrollBoundsIntoView(bounds); |
419 | | - } |
420 | 392 | } |
421 | 393 |
|
422 | 394 | /** |
|
0 commit comments