refactor: remove AnyDuringMigration from browser events (#6303)

* fix: bind data

* fix: use correct event types

* fix: make event happy with us clueging properties onto it

* fix: change thisObject to type Object | null

* chore: format

* chore: call out event conversion wierdness

* chore: fix build by changing things to use MouseEvent

* chore: remove default value for object

* fix: unbind trying to get an element of an empty array

* chore: format

* fix: call out potentially unsafe element access.

* chore: add issue number to TODO

* fix: attempt to fix CI build error?
This commit is contained in:
Beka Westberg
2022-08-04 17:35:02 +00:00
committed by GitHub
parent f70f82327b
commit dc44c66057
12 changed files with 55 additions and 57 deletions

View File

@@ -1700,7 +1700,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
* Handle a mouse-down on SVG drawing surface.
* @param e Mouse down event.
*/
private onMouseDown_(e: Event) {
private onMouseDown_(e: MouseEvent) {
const gesture = this.getGesture(e);
if (gesture) {
gesture.handleWsStart(e, this);
@@ -1712,7 +1712,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
* @param e Mouse down event.
* @param xy Starting location of object.
*/
startDrag(e: Event, xy: Coordinate) {
startDrag(e: MouseEvent, xy: Coordinate) {
// Record the starting offset between the bubble's location and the mouse.
const point = browserEvents.mouseToSvg(
e, this.getParentSvg(), this.getInverseScreenCTM());
@@ -1727,7 +1727,7 @@ export class WorkspaceSvg extends Workspace implements IASTNodeLocationSvg {
* @param e Mouse move event.
* @return New location of object.
*/
moveDrag(e: Event): Coordinate {
moveDrag(e: MouseEvent): Coordinate {
const point = browserEvents.mouseToSvg(
e, this.getParentSvg(), this.getInverseScreenCTM());
// Fix scale of mouse event.