mirror of
https://github.com/google/blockly.git
synced 2026-01-16 05:17:09 +01:00
fix: fix pinch to zoom (#6544)
* fix: fix pinch to zoom * chore: format
This commit is contained in:
committed by
Christopher Allen
parent
a7bff66dc0
commit
5cdcd02580
@@ -158,20 +158,20 @@ export function shouldHandleEvent(e: Event|PseudoEvent): boolean {
|
||||
* Get the touch identifier from the given event. If it was a mouse event, the
|
||||
* identifier is the string 'mouse'.
|
||||
*
|
||||
* @param e Mouse event or touch event.
|
||||
* @returns The touch identifier from the first changed touch, if defined.
|
||||
* Otherwise 'mouse'.
|
||||
* @param e Pointer event, mouse event, or touch event.
|
||||
* @returns The pointerId, or touch identifier from the first changed touch, if
|
||||
* defined. Otherwise 'mouse'.
|
||||
* @alias Blockly.Touch.getTouchIdentifierFromEvent
|
||||
*/
|
||||
export function getTouchIdentifierFromEvent(e: Event|PseudoEvent): string {
|
||||
if (e instanceof MouseEvent) {
|
||||
return 'mouse';
|
||||
}
|
||||
|
||||
if (e instanceof PointerEvent) {
|
||||
return String(e.pointerId);
|
||||
}
|
||||
|
||||
if (e instanceof MouseEvent) {
|
||||
return 'mouse';
|
||||
}
|
||||
|
||||
/**
|
||||
* TODO(#6097): Fix types. This is a catch-all for everything but mouse
|
||||
* and pointer events.
|
||||
|
||||
Reference in New Issue
Block a user