Finalized first implementation of Circle tool

This commit is contained in:
juliandescottes
2012-09-14 23:43:49 +02:00
parent f7d235b116
commit 2edda09f08
5 changed files with 51 additions and 22 deletions

View File

@ -34,7 +34,7 @@
}
// draw in overlay
this.drawRectangle(col, row, color, overlay);
this.drawRectangle_(col, row, color, overlay);
};
/**
@ -44,15 +44,15 @@
overlay.clear();
if(frame.containsPixel(col, row)) { // cancel if outside of canvas
// draw in frame to finalize
this.drawRectangle(col, row, color, frame);
this.drawRectangle_(col, row, color, frame);
}
};
ns.Rectangle.prototype.drawRectangle = function (col, row, color, targetFrame) {
ns.Rectangle.prototype.drawRectangle_ = function (col, row, color, targetFrame) {
var strokePoints = pskl.PixelUtils.getBoundRectanglePixels(this.startCol, this.startRow, col, row);
for(var i = 0; i< strokePoints.length; i++) {
// Change model:
targetFrame.setPixel(strokePoints[i].col, strokePoints[i].row, color);
}
}
};
})();