From 116fbc975315dc88fd87dda4a941cfb57ea1f94f Mon Sep 17 00:00:00 2001 From: Christopher Baines Date: Tue, 13 Sep 2011 10:53:16 +0100 Subject: Improved drawCircle. --- PunchingBag/src/PunchingBag.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'PunchingBag') diff --git a/PunchingBag/src/PunchingBag.java b/PunchingBag/src/PunchingBag.java index f27738f..271ef60 100644 --- a/PunchingBag/src/PunchingBag.java +++ b/PunchingBag/src/PunchingBag.java @@ -166,6 +166,7 @@ public class PunchingBag implements Runnable { double currentRadius = 0.5; public CircleExpand(int x, int y, int intensity) { + System.out.println("Circle Expand"); this.x = x + 0.5; this.y = y + 0.5; this.intensity = intensity; @@ -391,8 +392,8 @@ public class PunchingBag implements Runnable { int px; int py; for (double i = 0; i < 360; i++) { - px = (int) (x + Math.round(radius * Math.cos(i))); - py = (int) (y + Math.round(radius * Math.sin(i))); + px = (int) Math.round(x + (radius * Math.cos(i))); + py = (int) Math.round(y + (radius * Math.sin(i))); if (x >= 0 && x <= 8 && y >= 0 && y <= 19) { if (setLEDInternal(px, py, colour)) { -- cgit v1.2.3