From 366c0eb9777cb49ca8ed5f9e1b97ca57df24e67e Mon Sep 17 00:00:00 2001 From: blue Date: Mon, 19 Nov 2018 12:57:32 +0300 Subject: [PATCH] rectangle painting fix, circle painting fix --- painting/circle.js | 1 + painting/rectangle.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/painting/circle.js b/painting/circle.js index 09f9ff8..b51b270 100644 --- a/painting/circle.js +++ b/painting/circle.js @@ -8,6 +8,7 @@ class Circle extends Shape { } draw(ctx) { ctx.arc(this._x, this._y, this._r, 0, Math.PI * 2); + ctx.fill(); } static randomOptions() { diff --git a/painting/rectangle.js b/painting/rectangle.js index d83ff36..0969b8a 100644 --- a/painting/rectangle.js +++ b/painting/rectangle.js @@ -8,7 +8,7 @@ class Rectangle extends Shape { this._height = height; } draw(context) { - context.fillRect(this._x, this._y, this._x + this._width, this._y + this._height); + context.fillRect(this._x, this._y, this._width, this._height); } static randomOptions() {