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 ca26c6b commit 33087a7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 1 addition & 2 deletions js/building/view/NumberPieceNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import Property from '../../../../axon/js/Property.js';
import Vector2 from '../../../../dot/js/Vector2.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 Node from '../../../../scenery/js/nodes/Node.js';
import Rectangle from '../../../../scenery/js/nodes/Rectangle.js';
Expand Down Expand Up @@ -92,7 +91,7 @@ class NumberPieceNode extends Node {
transform: options.modelViewTransform,
positionProperty: numberPiece.positionProperty,
start: event => {
wasTouch = event.pointer instanceof Touch;
wasTouch = event.pointer.isTouchLike();
},
end: () => {
options.dropListener && options.dropListener( wasTouch );
Expand Down
3 changes: 1 addition & 2 deletions js/building/view/ShapePieceNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import Property from '../../../../axon/js/Property.js';
import Vector2 from '../../../../dot/js/Vector2.js';
import Shape from '../../../../kite/js/Shape.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 Circle from '../../../../scenery/js/nodes/Circle.js';
import Node from '../../../../scenery/js/nodes/Node.js';
Expand Down Expand Up @@ -138,7 +137,7 @@ class ShapePieceNode extends Node {
transform: options.modelViewTransform,
positionProperty: shapePiece.positionProperty,
start: event => {
wasTouch = event.pointer instanceof Touch;
wasTouch = event.pointer.isTouchLike();
},
end: () => {
options.dropListener && options.dropListener( wasTouch );
Expand Down

0 comments on commit 33087a7

Please sign in to comment.