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(); });