pub fn draw(&self, renderer: &mut Renderer) {
        renderer.fill_rect(self.outer_rect.to_sdl());

        let text_spacing = self.font.line_height();
        let mut y = self.inner_rect.y;

        let mut text_buffer = vec![];
        for (i, item) in self.items.iter().enumerate() {
            if i == self.selection {
                self.font.draw_char(renderer, text::encode_char('>') as i32 - 0x80,
                    self.inner_rect.x - self.font.char_width(), y);
            }

            text_buffer.extend(text::Encoder::new(&item));
            y += draw_text(renderer, &self.font, &text_buffer,
                &Rect::new(self.inner_rect.x, y, self.inner_rect.width, self.inner_rect.height));
            y += text_spacing;
            text_buffer.clear();
        }

        // Draw the chat border
        self.border.draw_box(renderer, self.outer_rect);
    }
/// Draws the item box to the screen.
/// TODO: Cache the render result
Draws the item box to the screen.
TODO: Cache the render result
Draws the item box to the screen . TODO : Cache the render result
pub fn draw(&self, renderer: &mut Renderer) {
        renderer.fill_rect(self.outer_rect.to_sdl());
        let text_spacing = self.font.line_height();
        let mut y = self.inner_rect.y;
        let mut text_buffer = vec![];
        for (i, item) in self.items.iter().enumerate() {
            if i == self.selection {
                self.font.draw_char(renderer, text::encode_char('>') as i32 - 0x80,
                    self.inner_rect.x - self.font.char_width(), y);
            }
            text_buffer.extend(text::Encoder::new(&item));
            y += draw_text(renderer, &self.font, &text_buffer,
                &Rect::new(self.inner_rect.x, y, self.inner_rect.width, self.inner_rect.height));
            y += text_spacing;
            text_buffer.clear();
        }
        // Draw the chat border
        self.border.draw_box(renderer, self.outer_rect);
    }
pub fn draw ( & self , renderer : & mut Renderer ) { renderer . fill_rect ( self . outer_rect . to_sdl ( ) ) ; let text_spacing = self . font . line_height ( ) ; let mut y = self . inner_rect . y ; let mut text_buffer = vec ! [ ] ; for ( i , item ) in self . items . iter ( ) . enumerate ( ) { if i == self . selection { self . font . draw_char ( renderer , text :: encode_char ( '>' ) as i32 - 0x80 , self . inner_rect . x - self . font . char_width ( ) , y ) ; } text_buffer . extend ( text :: Encoder :: new ( & item ) ) ; y += draw_text ( renderer , & self . font , & text_buffer , & Rect :: new ( self . inner_rect . x , y , self . inner_rect . width , self . inner_rect . height ) ) ; y += text_spacing ; text_buffer . clear ( ) ; } // Draw the chat border self . border . draw_box ( renderer , self . outer_rect ) ; }
Draws the item box to the screen.
Draws the item box to the screen .
&self
renderer
&mut Renderer
&self
renderer
&mut Renderer