pub fn fill_circle(&mut self, center: &Point, radius: Coord, color: Color) {
        let radius = radius.max(0.0);
        if radius == 0.0 {
            return;
        }
        let diameter = radius * 2.0;
        let top_left = *center - Point::new(radius, radius);
        let circle_bounds = Rect::new(top_left.to_point(), Size::new(diameter, diameter));
        let circle_bounds = circle_bounds.round_out().to_i32();
        if let Some(clipped_rect) = self.bounds.intersection(&circle_bounds) {
            let radius_squared = radius * radius;
            for y in clipped_rect.min_y()..clipped_rect.max_y() {
                let delta_y = y as Coord - center.y;
                let delta_y_2 = delta_y * delta_y;
                for x in clipped_rect.min_x()..clipped_rect.max_x() {
                    let delta_x = x as Coord - center.x;
                    let delta_x_2 = delta_x * delta_x;
                    if delta_x_2 + delta_y_2 < radius_squared {
                        let offset = self.offset_from_x_y(x, y);
                        self.write_color_at_offset(offset as usize, color);
                    }
                }
            }
        }
    }
/// Fill a circle with a particular color.
Fill a circle with a particular color.
Fill a circle with a particular color .
pub fn fill_circle(&mut self, center: &Point, radius: Coord, color: Color) {
        let radius = radius.max(0.0);
        if radius == 0.0 {
            return;
        }
        let diameter = radius * 2.0;
        let top_left = *center - Point::new(radius, radius);
        let circle_bounds = Rect::new(top_left.to_point(), Size::new(diameter, diameter));
        let circle_bounds = circle_bounds.round_out().to_i32();
        if let Some(clipped_rect) = self.bounds.intersection(&circle_bounds) {
            let radius_squared = radius * radius;
            for y in clipped_rect.min_y()..clipped_rect.max_y() {
                let delta_y = y as Coord - center.y;
                let delta_y_2 = delta_y * delta_y;
                for x in clipped_rect.min_x()..clipped_rect.max_x() {
                    let delta_x = x as Coord - center.x;
                    let delta_x_2 = delta_x * delta_x;
                    if delta_x_2 + delta_y_2 < radius_squared {
                        let offset = self.offset_from_x_y(x, y);
                        self.write_color_at_offset(offset as usize, color);
                    }
                }
            }
        }
    }
pub fn fill_circle ( & mut self , center : & Point , radius : Coord , color : Color ) { let radius = radius . max ( 0.0 ) ; if radius == 0.0 { return ; } let diameter = radius * 2.0 ; let top_left = * center - Point :: new ( radius , radius ) ; let circle_bounds = Rect :: new ( top_left . to_point ( ) , Size :: new ( diameter , diameter ) ) ; let circle_bounds = circle_bounds . round_out ( ) . to_i32 ( ) ; if let Some ( clipped_rect ) = self . bounds . intersection ( & circle_bounds ) { let radius_squared = radius * radius ; for y in clipped_rect . min_y ( ) .. clipped_rect . max_y ( ) { let delta_y = y as Coord - center . y ; let delta_y_2 = delta_y * delta_y ; for x in clipped_rect . min_x ( ) .. clipped_rect . max_x ( ) { let delta_x = x as Coord - center . x ; let delta_x_2 = delta_x * delta_x ; if delta_x_2 + delta_y_2 < radius_squared { let offset = self . offset_from_x_y ( x , y ) ; self . write_color_at_offset ( offset as usize , color ) ; } } } } }
Fill a circle with a particular color.
Fill a circle with a particular color .
&mut self
center
&Point
radius
Coord
color
Color
&mut self
center
&Point
radius
Coord
color
Color