Skip to content

Commit

Permalink
To avoid cirkular dependency between follow and pan.
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenbs committed Nov 6, 2011
1 parent e43a106 commit 5514af6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/extensions.js
Original file line number Diff line number Diff line change
Expand Up @@ -433,10 +433,10 @@ Crafty.extend({
return function (target, offsetx, offsety) {
if (oldTarget)
oldTarget.unbind('Change', change);
Crafty.viewport.pan('reset');
if (!target || !target.has('2D'))
return;

Crafty.viewport.pan('reset');

oldTarget = target;
offx = (typeof offsetx != 'undefined') ? offsetx : 0;
offy = (typeof offsety != 'undefined') ? offsety : 0;
Expand Down

0 comments on commit 5514af6

Please sign in to comment.