From b3fd354e14e2628557ee19bbacc05a70ffbcda6c Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Sun, 3 Mar 2019 11:27:23 +0200 Subject: [PATCH] HueRing: allow selecting the default hue which is not divisable by 15 --- .../main/java/net/ktnx/mobileledger/ui/HueRing.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/ui/HueRing.java b/app/src/main/java/net/ktnx/mobileledger/ui/HueRing.java index 493e6658..3f6dbb92 100644 --- a/app/src/main/java/net/ktnx/mobileledger/ui/HueRing.java +++ b/app/src/main/java/net/ktnx/mobileledger/ui/HueRing.java @@ -100,10 +100,12 @@ public class HueRing extends View { return hueDegrees; } public void setHue(int hueDegrees) { - // round to 15 degrees - int rem = hueDegrees % 15; - if (rem < 8) hueDegrees -= rem; - else hueDegrees += 15 - rem; + if (hueDegrees != Colors.DEFAULT_HUE_DEG) { + // round to 15 degrees + int rem = hueDegrees % 15; + if (rem < 8) hueDegrees -= rem; + else hueDegrees += 15 - rem; + } this.hueDegrees = hueDegrees; this.color = Colors.getPrimaryColorForHue(hueDegrees); -- 2.39.5