mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
Merge a22927d4d1
into ab89d4c16f
This commit is contained in:
commit
3c3e075d17
2 changed files with 18 additions and 0 deletions
|
@ -118,6 +118,7 @@ import {
|
||||||
DEFAULT_REDUCED_GLOBAL_ALPHA,
|
DEFAULT_REDUCED_GLOBAL_ALPHA,
|
||||||
isSafari,
|
isSafari,
|
||||||
type EXPORT_IMAGE_TYPES,
|
type EXPORT_IMAGE_TYPES,
|
||||||
|
DOUBLE_CLICK_POINTERUP_TIMEOUT,
|
||||||
} from "../constants";
|
} from "../constants";
|
||||||
import { exportCanvas, loadFromBlob } from "../data";
|
import { exportCanvas, loadFromBlob } from "../data";
|
||||||
import Library, { distributeLibraryItemsOnSquareGrid } from "../data/library";
|
import Library, { distributeLibraryItemsOnSquareGrid } from "../data/library";
|
||||||
|
@ -5350,6 +5351,14 @@ class App extends React.Component<AppProps, AppState> {
|
||||||
private handleCanvasDoubleClick = (
|
private handleCanvasDoubleClick = (
|
||||||
event: React.MouseEvent<HTMLCanvasElement>,
|
event: React.MouseEvent<HTMLCanvasElement>,
|
||||||
) => {
|
) => {
|
||||||
|
if (
|
||||||
|
this.lastPointerDownEvent &&
|
||||||
|
event.timeStamp - this.lastPointerDownEvent.timeStamp >
|
||||||
|
DOUBLE_CLICK_POINTERUP_TIMEOUT
|
||||||
|
) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// case: double-clicking with arrow/line tool selected would both create
|
// case: double-clicking with arrow/line tool selected would both create
|
||||||
// text and enter multiElement mode
|
// text and enter multiElement mode
|
||||||
if (this.state.multiElement) {
|
if (this.state.multiElement) {
|
||||||
|
@ -6345,6 +6354,7 @@ class App extends React.Component<AppProps, AppState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
this.maybeCleanupAfterMissingPointerUp(event.nativeEvent);
|
this.maybeCleanupAfterMissingPointerUp(event.nativeEvent);
|
||||||
|
|
||||||
this.maybeUnfollowRemoteUser();
|
this.maybeUnfollowRemoteUser();
|
||||||
|
|
||||||
if (this.state.searchMatches) {
|
if (this.state.searchMatches) {
|
||||||
|
|
|
@ -255,6 +255,14 @@ export const EXPORT_SOURCE =
|
||||||
// time in milliseconds
|
// time in milliseconds
|
||||||
export const IMAGE_RENDER_TIMEOUT = 500;
|
export const IMAGE_RENDER_TIMEOUT = 500;
|
||||||
export const TAP_TWICE_TIMEOUT = 300;
|
export const TAP_TWICE_TIMEOUT = 300;
|
||||||
|
/**
|
||||||
|
* The time the user has from 2nd pointerdown to following pointerup
|
||||||
|
* before it's not considered a double click.
|
||||||
|
*
|
||||||
|
* Helps prevent cases where you double-click by mistake but then drag/keep
|
||||||
|
* the pointer down for to cancel the double click or do another action.
|
||||||
|
*/
|
||||||
|
export const DOUBLE_CLICK_POINTERUP_TIMEOUT = 300;
|
||||||
export const TOUCH_CTX_MENU_TIMEOUT = 500;
|
export const TOUCH_CTX_MENU_TIMEOUT = 500;
|
||||||
export const TITLE_TIMEOUT = 10000;
|
export const TITLE_TIMEOUT = 10000;
|
||||||
export const VERSION_TIMEOUT = 30000;
|
export const VERSION_TIMEOUT = 30000;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue