From 3e2e12d00285ec813ca200c45ee35b3924994172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=A4rkl?= Date: Sun, 24 Nov 2019 14:48:51 +0100 Subject: [PATCH] Adjust Android Analog Stick Dimensions --- .../java/com/metallic/chiaki/touchcontrols/AnalogStickView.kt | 3 ++- android/app/src/main/res/values/dimens.xml | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/android/app/src/main/java/com/metallic/chiaki/touchcontrols/AnalogStickView.kt b/android/app/src/main/java/com/metallic/chiaki/touchcontrols/AnalogStickView.kt index 5767532..563463b 100644 --- a/android/app/src/main/java/com/metallic/chiaki/touchcontrols/AnalogStickView.kt +++ b/android/app/src/main/java/com/metallic/chiaki/touchcontrols/AnalogStickView.kt @@ -78,7 +78,8 @@ class AnalogStickView @JvmOverloads constructor( val center = center if(center != null) { - drawableBase?.setBounds((center.x - radius).toInt(), (center.y - radius).toInt(), (center.x + radius).toInt(), (center.y + radius).toInt()) + val circleRadius = radius + handleRadius + drawableBase?.setBounds((center.x - circleRadius).toInt(), (center.y - circleRadius).toInt(), (center.x + circleRadius).toInt(), (center.y + circleRadius).toInt()) drawableBase?.draw(canvas) val handleX = center.x + handlePosition.x * radius diff --git a/android/app/src/main/res/values/dimens.xml b/android/app/src/main/res/values/dimens.xml index e71e7d2..543f0f4 100644 --- a/android/app/src/main/res/values/dimens.xml +++ b/android/app/src/main/res/values/dimens.xml @@ -1,7 +1,7 @@ 48dp - 64dp - 16dp + 48dp + 32dp 48dp \ No newline at end of file