mirror of
https://github.com/piskelapp/piskel.git
synced 2023-08-10 21:12:52 +03:00
Added drawing loop, unplugged traditional renderers
This commit is contained in:
@@ -29,7 +29,6 @@
|
||||
var colDiff = col - this.startCol, rowDiff = row - this.startRow;
|
||||
if (colDiff != 0 || rowDiff != 0) {
|
||||
this.shiftFrame(colDiff, rowDiff, drawer.frame, this.frameClone);
|
||||
drawer.renderFrame();
|
||||
}
|
||||
};
|
||||
|
||||
|
@@ -21,10 +21,6 @@
|
||||
var targetColor = drawer.frame.getPixel(col, row);
|
||||
//this.recursiveFloodFill_(frame, col, row, targetColor, color);
|
||||
this.queueLinearFloodFill_(drawer.frame, col, row, targetColor, color);
|
||||
|
||||
// Draw in canvas:
|
||||
// TODO: Remove that when we have the centralized redraw loop
|
||||
drawer.renderFrame();
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -25,7 +25,6 @@
|
||||
|
||||
// Drawing the first point of the rectangle in the fake overlay canvas:
|
||||
drawer.overlayFrame.setPixel(col, row, color);
|
||||
drawer.renderOverlay();
|
||||
};
|
||||
|
||||
ns.Rectangle.prototype.moveToolAt = function(col, row, color, drawer) {
|
||||
@@ -44,13 +43,13 @@
|
||||
}
|
||||
drawer.overlayFrame.setPixel(strokePoints[i].col, strokePoints[i].row, color);
|
||||
}
|
||||
drawer.renderOverlay();
|
||||
};
|
||||
|
||||
/**
|
||||
* @override
|
||||
*/
|
||||
ns.Rectangle.prototype.releaseToolAt = function(col, row, color, drawer) {
|
||||
drawer.clearOverlay();
|
||||
// If the stroke tool is released outside of the canvas, we cancel the stroke:
|
||||
if(drawer.frame.containsPixel(col, row)) {
|
||||
var strokePoints = this.getRectanglePixels_(this.startCol, col, this.startRow, row);
|
||||
@@ -59,12 +58,8 @@
|
||||
drawer.frame.setPixel(strokePoints[i].col, strokePoints[i].row, color);
|
||||
}
|
||||
// The user released the tool to draw a line. We will compute the pixel coordinate, impact
|
||||
// the model and draw them in the drawing canvas (not the fake overlay anymore)
|
||||
// Draw in canvas:
|
||||
// TODO: Remove that when we have the centralized redraw loop
|
||||
drawer.renderFrame();
|
||||
// the model and draw them in the drawing canvas (not the fake overlay anymore)
|
||||
}
|
||||
drawer.clearOverlay();
|
||||
};
|
||||
|
||||
/**
|
||||
|
@@ -23,10 +23,6 @@
|
||||
this.previousCol = col;
|
||||
this.previousRow = row;
|
||||
drawer.frame.setPixel(col, row, color);
|
||||
|
||||
// Draw on canvas:
|
||||
// TODO: Remove that when we have the centralized redraw loop
|
||||
drawer.renderFramePixel(col, row);
|
||||
}
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user