kopia lustrzana https://github.com/Tldraw/Tldraw
pull/3282/head
rodzic
e209256084
commit
009ecc2b5a
|
@ -1,4 +1,5 @@
|
|||
import React, { useMemo } from 'react'
|
||||
import { RIGHT_MOUSE_BUTTON } from '../constants'
|
||||
import {
|
||||
preventDefault,
|
||||
releasePointerCapture,
|
||||
|
@ -19,7 +20,7 @@ export function useCanvasEvents() {
|
|||
function onPointerDown(e: React.PointerEvent) {
|
||||
if ((e as any).isKilled) return
|
||||
|
||||
if (e.button === 2) {
|
||||
if (e.button === RIGHT_MOUSE_BUTTON) {
|
||||
editor.dispatch({
|
||||
type: 'pointer',
|
||||
target: 'canvas',
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import { useMemo } from 'react'
|
||||
import { RIGHT_MOUSE_BUTTON } from '../constants'
|
||||
import { TLSelectionHandle } from '../editor/types/selection-types'
|
||||
import {
|
||||
loopToHtmlElement,
|
||||
|
@ -18,7 +19,7 @@ export function useSelectionEvents(handle: TLSelectionHandle) {
|
|||
const onPointerDown: React.PointerEventHandler = (e) => {
|
||||
if ((e as any).isKilled) return
|
||||
|
||||
if (e.button === 2) {
|
||||
if (e.button === RIGHT_MOUSE_BUTTON) {
|
||||
editor.dispatch({
|
||||
type: 'pointer',
|
||||
target: 'selection',
|
||||
|
|
|
@ -641,6 +641,7 @@ export function useNativeClipboardEvents() {
|
|||
let disablingMiddleClickPaste = false
|
||||
const pointerUpHandler = (e: PointerEvent) => {
|
||||
if (e.button === 1) {
|
||||
// middle mouse button
|
||||
disablingMiddleClickPaste = true
|
||||
requestAnimationFrame(() => {
|
||||
disablingMiddleClickPaste = false
|
||||
|
|
Ładowanie…
Reference in New Issue