[Editor] Avoid to trigger an editor creation when pinching on a touch screen
This commit is contained in:
parent
86165a7ba6
commit
6b545d666e
@ -553,6 +553,15 @@ class AnnotationEditorLayer {
|
|||||||
* @param {PointerEvent} event
|
* @param {PointerEvent} event
|
||||||
*/
|
*/
|
||||||
pointerdown(event) {
|
pointerdown(event) {
|
||||||
|
if (this.#hadPointerDown) {
|
||||||
|
// It's possible to have a second pointerdown event before a pointerup one
|
||||||
|
// when the user puts a finger on a touchscreen and then add a second one
|
||||||
|
// to start a pinch-to-zoom gesture.
|
||||||
|
// That said, in case it's possible to have two pointerdown events with
|
||||||
|
// a mouse, we don't want to create a new editor in such a case either.
|
||||||
|
this.#hadPointerDown = false;
|
||||||
|
return;
|
||||||
|
}
|
||||||
const { isMac } = FeatureTest.platform;
|
const { isMac } = FeatureTest.platform;
|
||||||
if (event.button !== 0 || (event.ctrlKey && isMac)) {
|
if (event.button !== 0 || (event.ctrlKey && isMac)) {
|
||||||
// Do nothing on right click.
|
// Do nothing on right click.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user