From 6fb774964265ef137211563eaa20bc174de863c6 Mon Sep 17 00:00:00 2001 From: Savanni D'Gerinel Date: Wed, 9 Aug 2023 10:58:23 -0400 Subject: [PATCH] re-add the tick marks --- dashboard/src/drawing/pie_chart.rs | 2 +- dashboard/src/main.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dashboard/src/drawing/pie_chart.rs b/dashboard/src/drawing/pie_chart.rs index 8b9e97a..4d394d2 100644 --- a/dashboard/src/drawing/pie_chart.rs +++ b/dashboard/src/drawing/pie_chart.rs @@ -55,7 +55,7 @@ impl PieChart { pub fn draw(self, context: &Context) { println!("drawing: {} {}", self.width, self.height); - let radius = self.width.min(self.height) as f64 / 2. * 0.9; + let radius = self.width.min(self.height) as f64 / 2.; let center_x = (self.width / 2) as f64; let center_y = (self.height / 2) as f64; diff --git a/dashboard/src/main.rs b/dashboard/src/main.rs index 111feb8..ecf1ec7 100644 --- a/dashboard/src/main.rs +++ b/dashboard/src/main.rs @@ -252,7 +252,7 @@ impl TransitClock { move |_, context, width, height| { let center_x = width as f64 / 2.; let center_y = height as f64 / 2.; - let radius = width.min(height) as f64 / 2.; + let radius = width.min(height) as f64 / 2. * 0.9; if let Some(ref info) = *s.imp().info.borrow() { let full_day = Duration::days(1).num_seconds() as f64; let sunrise = info.sunrise - NaiveTime::from_hms_opt(0, 0, 0).unwrap(); @@ -280,8 +280,8 @@ impl TransitClock { context.set_source_rgb(0., 0., 0.); context.translate(center_x, center_y); context.rotate(tick as f64 * (PI / 12.)); - context.move_to(center_x, center_y); - context.line_to(center_x + 10., center_y); + context.move_to(radius, 0.); + context.line_to(radius - 10., 0.); let _ = context.stroke(); context.identity_matrix(); });