Improves layout on mobile

This commit is contained in:
Steve Ruiz 2021-06-01 09:56:41 +01:00
parent 7b1dcdeeeb
commit ea996b627b
10 changed files with 87 additions and 74 deletions

View file

@ -11,6 +11,7 @@ import Bounds from './bounds/bounding-box'
import BoundsBg from './bounds/bounds-bg'
import Selected from './selected'
import Handles from './bounds/handles'
import { isMobile } from 'utils/utils'
export default function Canvas() {
const rCanvas = useRef<SVGSVGElement>(null)
@ -30,6 +31,10 @@ export default function Canvas() {
const handleTouchStart = useCallback((e: React.TouchEvent) => {
if (e.touches.length === 2) {
state.send('TOUCH_UNDO')
} else {
if (isMobile()) {
state.send('TOUCHED_CANVAS')
}
}
}, [])