From bfebe037d7e92a1404f877bfbf5cc9debd3d3905 Mon Sep 17 00:00:00 2001 From: admar Date: Fri, 26 May 2023 23:24:55 +0200 Subject: [PATCH] Draw slightly bigger black circle underneath colored circles --- clock.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/clock.py b/clock.py index d86dde2..3a09126 100644 --- a/clock.py +++ b/clock.py @@ -609,20 +609,28 @@ class MyClockWidget(FloatLayout): color = self.aqi_colors[idx] if color != [0.0, 0.0, 0.0]: - self.draw_list_curr_frame.append(["Color", face_plate.canvas, color[0], color[1], color[2]]) + # Draw black circle R = face_plate.size[0] / 2 + r = R / 10 * 1.05 + coord_x = 0.5 + location*math.sin(2 * math.pi * i/12) + coord_y = 0.5 + location*math.cos(2 * math.pi * i/12) + p = [face_plate.pos[0] + 2 * R * coord_x - r, face_plate.pos[1] + 2 * R * coord_y - r] + self.draw_list_curr_frame.append(["Color", face_plate.canvas, 0, 0, 0]) + self.draw_list_curr_frame.append(["Ellipse", face_plate.canvas, [2 * r, 2 * r], p]) + + # Draw slightly smaller colored circle r = R / 10 coord_x = 0.5 + location*math.sin(2 * math.pi * i/12) coord_y = 0.5 + location*math.cos(2 * math.pi * i/12) p = [face_plate.pos[0] + 2 * R * coord_x - r, face_plate.pos[1] + 2 * R * coord_y - r] - #self.draw_list_curr_frame.append(["Circle", face_plate.canvas, p, r / 10]) + self.draw_list_curr_frame.append(["Color", face_plate.canvas, color[0], color[1], color[2]]) self.draw_list_curr_frame.append(["Ellipse", face_plate.canvas, [2 * r, 2 * r], p]) def draw_rain_expectation(self): self.draw_rain_aqi_expectation(self.rain, self.rain_thresholds, 0.45) def draw_aqi_expectation(self): - self.draw_rain_aqi_expectation(self.paqi, self.paqi_thresholds, 0.35) + self.draw_rain_aqi_expectation(self.paqi, self.paqi_thresholds, 0.32) def draw_face(self): self.draw_numbers()