From 024c3c1b45a6a319aa97bbe7af80a79873269c5e Mon Sep 17 00:00:00 2001 From: Nick Renieris Date: Thu, 26 Sep 2019 23:13:36 +0300 Subject: [PATCH] gui/game/brush: Add smooth/organic elliptical brush Not sure why TPT's ellptical brush currently looks like that, when you type "pixel circle" on Google every result is the smooth version. Got the idea from this post: https://powdertoy.co.uk/Browse/View.html?ID=2464991 Signed-off-by: Nick Renieris --- src/gui/game/EllipseBrush.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/game/EllipseBrush.h b/src/gui/game/EllipseBrush.h index 3d8c56ba0..6444fba65 100644 --- a/src/gui/game/EllipseBrush.h +++ b/src/gui/game/EllipseBrush.h @@ -31,7 +31,9 @@ public: int yTop = ry+1, yBottom, i; for (i = 0; i <= rx; i++) { - while (pow(i-rx,2.0)*pow(ry,2.0) + pow(yTop-ry,2.0)*pow(rx,2.0) <= pow(rx,2.0)*pow(ry,2.0)) + while ( pow(i - rx, 2.0) * pow(ry - 0.5, 2.0) + + pow(yTop - ry, 2.0) * pow(rx - 0.5, 2.0) <= + pow(rx, 2.0) * pow(ry, 2.0)) yTop++; yBottom = 2*ry - yTop; for (int j = 0; j <= ry*2; j++)