added loading over + fixed bug with highlighted pixel removal

This commit is contained in:
juliandescottes
2013-12-23 15:04:13 +01:00
parent 4056142b97
commit fbdf1aaf9a
5 changed files with 36 additions and 14 deletions

View File

@ -32,9 +32,11 @@
};
ns.BaseTool.prototype.hideHighlightedPixel = function(overlay) {
overlay.setPixel(this.highlightedPixelCol, this.highlightedPixelRow, Constants.TRANSPARENT_COLOR);
this.highlightedPixelRow = null;
this.highlightedPixelCol = null;
if (this.highlightedPixelRow !== null && this.highlightedPixelCol !== null) {
overlay.setPixel(this.highlightedPixelCol, this.highlightedPixelRow, Constants.TRANSPARENT_COLOR);
this.highlightedPixelRow = null;
this.highlightedPixelCol = null;
}
};

View File

@ -70,6 +70,9 @@
}
};
ns.BaseSelect.prototype.hideHighlightedPixel = function () {
// not implemented for selection tools
};
/**
* If we mouseover the selection draw inside the overlay frame, show the 'move' cursor

View File

@ -6,7 +6,6 @@
this.isRunning = false;
this.previousTime = 0;
this.callbacks = [];
this.i = 0;
};
ns.DrawingLoop.prototype.addCallback = function (callback, scope, args) {
@ -34,10 +33,7 @@
ns.DrawingLoop.prototype.loop_ = function () {
var currentTime = Date.now();
var delta = currentTime - this.previousTime;
this.i++;
if(this.i%2 === 0) {
this.executeCallbacks_(delta);
}
this.executeCallbacks_(delta);
this.previousTime = currentTime;
this.requestAnimationFrame.call(window, this.loop_.bind(this));
};