revert: "refactor: Remove block and workspace drag surfaces (#6758)" (#6888)

This reverts commit 332c0fd2f2.
This commit is contained in:
Maribeth Bottorff
2023-03-09 13:43:12 -08:00
committed by GitHub
parent c0934216f8
commit cdb1215d95
15 changed files with 791 additions and 30 deletions

View File

@@ -20,6 +20,9 @@ import type {WorkspaceSvg} from './workspace_svg.js';
/**
* Class for a workspace dragger. It moves the workspace around when it is
* being dragged by a mouse or touch.
* Note that the workspace itself manages whether or not it has a drag surface
* and how to do translations based on that. This simply passes the right
* commands based on events.
*/
export class WorkspaceDragger {
private readonly horizontalScrollEnabled_: boolean;
@@ -62,6 +65,7 @@ export class WorkspaceDragger {
if (common.getSelected()) {
common.getSelected()!.unselect();
}
this.workspace.setupDragSurface();
}
/**
@@ -74,6 +78,7 @@ export class WorkspaceDragger {
endDrag(currentDragDeltaXY: Coordinate) {
// Make sure everything is up to date.
this.drag(currentDragDeltaXY);
this.workspace.resetDragSurface();
}
/**