You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
261 B
Rust

use std::f64;
pub fn draw_circle(center: (f64, f64), radius: f64, context: &web_sys::CanvasRenderingContext2d) {
let (x, y) = center;
context.move_to(x+radius, y);
context
.arc(x, y, radius, 0.0, f64::consts::PI * 2.0)
.unwrap();
}