/// Fill a rectangle with a particular color.
Fill a rectangle with a particular color.
Fill a rectangle with a particular color .
pub fn fill_rect(&mut self, rect: &Rect, color: Color) {
        if rect.is_empty() {
            return;
        }
        let rect = rect.round_out().to_i32();
        if let Some(clipped_rect) = self.bounds.intersection(&rect) {
            for y in clipped_rect.min_y()..clipped_rect.max_y() {
                for x in clipped_rect.min_x()..clipped_rect.max_x() {
                    let offset = self.offset_from_x_y(x, y);
                    self.write_color_at_offset(offset as usize, color);
                }
            }
        }
    }
pub fn fill_rect ( & mut self , rect : & Rect , color : Color ) { if rect . is_empty ( ) { return ; } let rect = rect . round_out ( ) . to_i32 ( ) ; if let Some ( clipped_rect ) = self . bounds . intersection ( & rect ) { for y in clipped_rect . min_y ( ) .. clipped_rect . max_y ( ) { for x in clipped_rect . min_x ( ) .. clipped_rect . max_x ( ) { let offset = self . offset_from_x_y ( x , y ) ; self . write_color_at_offset ( offset as usize , color ) ; } } } }
Fill a rectangle with a particular color.
Fill a rectangle with a particular color .
&mut self
rect
&Rect
color
Color