mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Merge pull request #36 from juliandescottes/fix-stroke-tool
Fix stroke tool
This commit is contained in:
commit
d991441b5b
@ -39,13 +39,11 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
ns.Stroke.prototype.moveToolAt = function(col, row, color, drawer) {
|
ns.Stroke.prototype.moveToolAt = function(col, row, color, drawer) {
|
||||||
|
drawer.clearOverlay();
|
||||||
|
|
||||||
// When the user moussemove (before releasing), we dynamically compute the
|
// When the user moussemove (before releasing), we dynamically compute the
|
||||||
// pixel to draw the line and draw this line in the overlay canvas:
|
// pixel to draw the line and draw this line in the overlay canvas:
|
||||||
var strokePoints = this.getLinePixels_(this.startCol, col, this.startRow, row);
|
var strokePoints = this.getLinePixels_(this.startCol, col, this.startRow, row);
|
||||||
|
|
||||||
// Clean overlay canvas:
|
|
||||||
this.canvasOverlay.getContext("2d").clearRect(
|
|
||||||
0, 0, this.canvasOverlay.width, this.canvasOverlay.height);
|
|
||||||
|
|
||||||
// Drawing current stroke:
|
// Drawing current stroke:
|
||||||
for(var i = 0; i< strokePoints.length; i++) {
|
for(var i = 0; i< strokePoints.length; i++) {
|
||||||
@ -61,6 +59,7 @@
|
|||||||
}
|
}
|
||||||
drawer.updateOverlay(strokePoints[i].col, strokePoints[i].row, color);
|
drawer.updateOverlay(strokePoints[i].col, strokePoints[i].row, color);
|
||||||
}
|
}
|
||||||
|
drawer.renderOverlay();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user