Grab cursor for drag-panning

This commit is contained in:
Jamie Wong 2017-12-29 22:22:58 -05:00
parent 09a2b60512
commit e59299cfc5

View File

@ -432,6 +432,8 @@ export class FlamechartPanZoomView extends ReloadableComponent<FlamechartPanZoom
private lastDragPos: Vec2 | null = null private lastDragPos: Vec2 | null = null
private onMouseDown = (ev: MouseEvent) => { private onMouseDown = (ev: MouseEvent) => {
document.body.style.cursor = 'grabbing'
document.body.style.cursor = '-webkit-grabbing'
this.lastDragPos = new Vec2(ev.offsetX, ev.offsetY) this.lastDragPos = new Vec2(ev.offsetX, ev.offsetY)
} }
@ -507,6 +509,7 @@ export class FlamechartPanZoomView extends ReloadableComponent<FlamechartPanZoom
} }
private onWindowMouseUp = (ev: MouseEvent) => { private onWindowMouseUp = (ev: MouseEvent) => {
document.body.style.cursor = 'default'
this.lastDragPos = null this.lastDragPos = null
} }