From c381f3e6fbdd3915380f904190f4a8bb775cb8c3 Mon Sep 17 00:00:00 2001 From: zepumph Date: Tue, 16 Feb 2021 15:50:58 -0900 Subject: [PATCH] Create Pointer.isTouchLike(), convert usages of instance Touch to use it, https://github.com/phetsims/scenery/issues/1156 --- js/view/CircuitElementToolNode.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/js/view/CircuitElementToolNode.js b/js/view/CircuitElementToolNode.js index cfdc3e13..e3803228 100644 --- a/js/view/CircuitElementToolNode.js +++ b/js/view/CircuitElementToolNode.js @@ -10,7 +10,6 @@ import BooleanProperty from '../../../axon/js/BooleanProperty.js'; import Property from '../../../axon/js/Property.js'; import merge from '../../../phet-core/js/merge.js'; -import Touch from '../../../scenery/js/input/Touch.js'; import DragListener from '../../../scenery/js/listeners/DragListener.js'; import Text from '../../../scenery/js/nodes/Text.js'; import VBox from '../../../scenery/js/nodes/VBox.js'; @@ -65,7 +64,7 @@ class CircuitElementToolNode extends VBox { // Adjust for touch. The object should appear centered on the mouse but vertically above the finger so the finger // doesn't obscure the object - viewPosition.y = viewPosition.y - ( event.pointer instanceof Touch ? 28 : 0 ); + viewPosition.y = viewPosition.y - ( event.pointer.isTouchLike() ? 28 : 0 ); // Create the new CircuitElement at the correct position const circuitElement = createElement( viewPosition, event );