Skip to content

Commit

Permalink
Create Pointer.isTouchLike(), convert usages of instance Touch to use…
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Feb 17, 2021
1 parent 62d1650 commit c381f3e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions js/view/CircuitElementToolNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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 );
Expand Down

0 comments on commit c381f3e

Please sign in to comment.