mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-23 00:28:06 +02:00
Merge pull request #16741 from calixteman/editor_no_ed_when_pinching
[Editor] Avoid to trigger an editor creation when pinching on a touchscreen
This commit is contained in:
commit
48cc67f17e
1 changed files with 9 additions and 0 deletions
|
@ -553,6 +553,15 @@ class AnnotationEditorLayer {
|
|||
* @param {PointerEvent} 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;
|
||||
if (event.button !== 0 || (event.ctrlKey && isMac)) {
|
||||
// Do nothing on right click.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue