commit 34e5616e54c603da97b42942fdff2aec5d3a1af6 parent 4665d32a26b4a4a4b4ea684d1ebc97376fbfa6ba Author: gstraube <gstraube@mailbox.org> Date: Thu, 13 Jul 2017 20:03:58 +0200 Use absolute value when comparing to maximum allowed deviation Diffstat:
| M | app/src/main/java/com/github/cythara/TunerView.java | | | 2 | +- |
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/src/main/java/com/github/cythara/TunerView.java b/app/src/main/java/com/github/cythara/TunerView.java @@ -52,7 +52,7 @@ public class TunerView extends View { private void setBackground(Canvas canvas) { int color = Color.RED; - if (pitchDifference.deviation <= MAX_ALLOWED_DEVIATION) { + if (Math.abs(pitchDifference.deviation) <= MAX_ALLOWED_DEVIATION) { color = Color.GREEN; } background.setColor(color);