feat: clearCanvas in fillRect
This commit is contained in:
parent
65064ac407
commit
bcdc8df943
@ -754,6 +754,13 @@ module.exports = (function () {
|
|||||||
* adds a rectangle element
|
* adds a rectangle element
|
||||||
*/
|
*/
|
||||||
ctx.prototype.fillRect = function (x, y, width, height) {
|
ctx.prototype.fillRect = function (x, y, width, height) {
|
||||||
|
let {a, b, c, d, e, f} = this.getTransform();
|
||||||
|
if (JSON.stringify([a, b, c, d, e, f]) === JSON.stringify([1, 0, 0, 1, 0, 0])) {
|
||||||
|
//clear entire canvas
|
||||||
|
if (x === 0 && y === 0 && width === this.width && height === this.height) {
|
||||||
|
this.__clearCanvas();
|
||||||
|
}
|
||||||
|
}
|
||||||
var rect, parent;
|
var rect, parent;
|
||||||
rect = this.__createElement("rect", {
|
rect = this.__createElement("rect", {
|
||||||
x : x,
|
x : x,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user