Skip to content

Commit 5647442

Browse files
committed
Use Events and remove dead code
1 parent afe3d7f commit 5647442

1 file changed

Lines changed: 4 additions & 9 deletions

File tree

src/cameras/2d/effects/RotateTo.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
var Clamp = require('../../../math/Clamp');
88
var Class = require('../../../utils/Class');
9+
var Events = require('../events');
910
var EaseMap = require('../../../math/easing/EaseMap');
1011

1112
/**
@@ -256,18 +257,12 @@ var RotateTo = new Class({
256257
this._onUpdateScope = context;
257258

258259

259-
if (this.shortestPath === true)
260+
if (this.shortestPath)
260261
{
261262
// The shortest path is true so calculate the quickest direction
262263
var cwDist = 0;
263264
var acwDist = 0;
264265

265-
if (this.clockwise === false)
266-
{
267-
target = this.current;
268-
current = this.destination;
269-
}
270-
271266
if (this.destination > this.source)
272267
{
273268
cwDist = Math.abs(this.destination - this.source);
@@ -296,7 +291,7 @@ var RotateTo = new Class({
296291
}
297292
}
298293

299-
this.camera.emit('camerarotatestart', this.camera, this, duration, tmpDestination);
294+
this.camera.emit(Events.ROTATE_START, this.camera, this, duration, tmpDestination);
300295

301296
return cam;
302297
},
@@ -394,7 +389,7 @@ var RotateTo = new Class({
394389

395390
this.isRunning = false;
396391

397-
this.camera.emit('camerarotatecomplete', this.camera, this);
392+
this.camera.emit(Events.ROTATE_COMPLETE, this.camera, this);
398393
},
399394

400395
/**

0 commit comments

Comments
 (0)