prevent scrolling canvas on mobile (#156)

This commit is contained in:
dank074 2023-07-20 20:57:46 -05:00 committed by GitHub
parent 1d151a4f06
commit 29abb568ae
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -33,6 +33,8 @@ export class FloorplanEditor
canvas.height = height;
canvas.width = width;
canvas.style.touchAction = 'none';
this._renderer = canvas.getContext('2d');
this._image = new Image();

View File

@ -138,8 +138,7 @@ export const FloorplanCanvasView: FC<ColumnProps> = props =>
const currentElement = elementRef.current;
if(!currentElement) return;
currentElement.appendChild(FloorplanEditor.instance.renderer.canvas);
currentElement.addEventListener('pointerup', onPointerEvent);