Add touch event handlers for canvas
This commit is contained in:
parent
e6aac849fd
commit
cca45c8bbe
@ -800,6 +800,9 @@ export default function Editor(props: EditorProps) {
|
|||||||
onMouseDown={onMouseDown}
|
onMouseDown={onMouseDown}
|
||||||
onMouseUp={onCanvasMouseUp}
|
onMouseUp={onCanvasMouseUp}
|
||||||
onMouseMove={onMouseDrag}
|
onMouseMove={onMouseDrag}
|
||||||
|
onTouchStart={onMouseDown}
|
||||||
|
onTouchEnd={onCanvasMouseUp}
|
||||||
|
onTouchMove={onMouseDrag}
|
||||||
ref={(r) => {
|
ref={(r) => {
|
||||||
if (r && !context) {
|
if (r && !context) {
|
||||||
const ctx = r.getContext("2d")
|
const ctx = r.getContext("2d")
|
||||||
|
Loading…
Reference in New Issue
Block a user