Added JSCS linter to enforce style conventions

This commit is contained in:
juliandescottes
2015-04-14 18:02:33 +02:00
parent 007e4d4e11
commit b480acc6a0
150 changed files with 847 additions and 848 deletions

View File

@@ -4,11 +4,11 @@
* @require pskl.utils
*/
(function() {
var ns = $.namespace("pskl.tools.drawing");
var ns = $.namespace('pskl.tools.drawing');
ns.SimplePen = function() {
this.toolId = "tool-pen";
this.helpText = "Pen tool";
this.toolId = 'tool-pen';
this.helpText = 'Pen tool';
this.previousCol = null;
this.previousRow = null;
@@ -41,17 +41,16 @@
* @override
*/
ns.SimplePen.prototype.moveToolAt = function(col, row, color, frame, overlay, event) {
if((Math.abs(col - this.previousCol) > 1) || (Math.abs(row - this.previousRow) > 1)) {
if ((Math.abs(col - this.previousCol) > 1) || (Math.abs(row - this.previousRow) > 1)) {
// The pen movement is too fast for the mousemove frequency, there is a gap between the
// current point and the previously drawn one.
// We fill the gap by calculating missing dots (simple linear interpolation) and draw them.
var interpolatedPixels = this.getLinePixels_(col, this.previousCol, row, this.previousRow);
for(var i=0, l=interpolatedPixels.length; i<l; i++) {
for (var i = 0, l = interpolatedPixels.length ; i < l ; i++) {
var coords = interpolatedPixels[i];
this.applyToolAt(coords.col, coords.row, color, frame, overlay, event);
}
}
else {
} else {
this.applyToolAt(col, row, color, frame, overlay, event);
}
@@ -59,7 +58,6 @@
this.previousRow = row;
};
ns.SimplePen.prototype.releaseToolAt = function(col, row, color, frame, overlay, event) {
// apply on real frame
this.setPixelsToFrame_(frame, this.pixels);