Skip to content

Commit

Permalink
fixed clientX/Y not a function error
Browse files Browse the repository at this point in the history
see issue threeDart#199
  • Loading branch information
DerKorb committed Aug 12, 2015
1 parent 06acdb7 commit f6297ec
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions lib/extras/controls/orbit_controls.dart
Original file line number Diff line number Diff line change
Expand Up @@ -407,23 +407,23 @@ class OrbitControls extends EventEmitter {

_state = STATE.ROTATE;

_rotateStart = new Vector2(event.clientX.toDouble(), event.clientY.toDouble());
_rotateStart = new Vector2(event.client.x.toDouble(), event.client.y.toDouble());

} else if (event.button == 1) {

if (noZoom == true) return;

_state = STATE.DOLLY;

_dollyStart = new Vector2(event.clientX.toDouble(), event.clientY.toDouble());
_dollyStart = new Vector2(event.client.x.toDouble(), event.client.y.toDouble());

} else if (event.button == 2) {

if (noPan == true) return;

_state = STATE.PAN;

_panStart = new Vector2(event.clientX.toDouble(), event.clientY.toDouble());
_panStart = new Vector2(event.client.x.toDouble(), event.client.y.toDouble());

}

Expand All @@ -445,7 +445,7 @@ class OrbitControls extends EventEmitter {

if (noRotate == true) return;

_rotateEnd = new Vector2(event.clientX.toDouble(), event.clientY.toDouble());
_rotateEnd = new Vector2(event.client.x.toDouble(), event.client.y.toDouble());
_rotateDelta = _rotateEnd - _rotateStart;

// Rotating across the whole screen is 360 degrees around.
Expand All @@ -461,7 +461,7 @@ class OrbitControls extends EventEmitter {

if (noZoom == true) return;

_dollyEnd = new Vector2(event.clientX.toDouble(), event.clientY.toDouble());
_dollyEnd = new Vector2(event.client.x.toDouble(), event.client.y.toDouble());
_dollyDelta = _dollyEnd - _dollyStart;

if (_dollyDelta.y > 0) {
Expand All @@ -480,7 +480,7 @@ class OrbitControls extends EventEmitter {

if (noPan == true) return;

_panEnd = new Vector2(event.clientX.toDouble(), event.clientY.toDouble());
_panEnd = new Vector2(event.client.x.toDouble(), event.client.y.toDouble());
_panDelta = _panEnd - _panStart;

pan(_panDelta.x.toDouble(), _panDelta.y.toDouble());
Expand Down

0 comments on commit f6297ec

Please sign in to comment.