From 0e16dacf1397a6b07310b20c838f6de3aab1526f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Capucho?= Date: Thu, 4 Aug 2022 13:59:37 +0100 Subject: [PATCH] Fix hue ring thumb not scaling with stroke width --- lib/src/palette.dart | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/src/palette.dart b/lib/src/palette.dart index bda005f..eedcfc7 100644 --- a/lib/src/palette.dart +++ b/lib/src/palette.dart @@ -550,10 +550,19 @@ class HueRingPainter extends CustomPainter { center.dx + radio * cos((hsvColor.hue * pi / 180)), center.dy - radio * sin((hsvColor.hue * pi / 180)), ); - canvas.drawShadow(Path()..addOval(Rect.fromCircle(center: offset, radius: 12)), Colors.black, 3.0, true); + canvas.drawShadow( + Path() + ..addOval(Rect.fromCircle( + center: offset, + radius: strokeWidth / 2 + strokeWidth * 0.1, + )), + Colors.black, + 3.0, + true, + ); canvas.drawCircle( offset, - size.height * 0.04, + strokeWidth / 1.8, Paint() ..color = Colors.white ..style = PaintingStyle.fill, @@ -561,7 +570,7 @@ class HueRingPainter extends CustomPainter { if (displayThumbColor) { canvas.drawCircle( offset, - size.height * 0.03, + strokeWidth / 2 - strokeWidth * 0.1, Paint() ..color = hsvColor.toColor() ..style = PaintingStyle.fill,