fn new_line(&mut self) {
        self.x = 0;
        self.y += 1;

        if self.y >= self.height / FONT_HEIGHT {
            // This is very slow, it would be better to have a buffer with the characters.
            // But this is only a debug output after all...
            for y in 0..self.height - FONT_HEIGHT {
                for x in 0..self.width {
                    let color = self.get_pixel(x, y + FONT_HEIGHT);
                    self.set_pixel(x, y, color);
                }
            }
            for y in self.height - FONT_HEIGHT..self.height {
                for x in 0..self.width {
                    self.set_pixel(x, y, 0);
                }
            }

            self.y -= 1;
        }
    }
/// Goes to a new line and shifts the text up if required.
Goes to a new line and shifts the text up if required.
Goes to a new line and shifts the text up if required .
fn new_line(&mut self) {
        self.x = 0;
        self.y += 1;
        if self.y >= self.height / FONT_HEIGHT {
            // This is very slow, it would be better to have a buffer with the characters.
            // But this is only a debug output after all...
            for y in 0..self.height - FONT_HEIGHT {
                for x in 0..self.width {
                    let color = self.get_pixel(x, y + FONT_HEIGHT);
                    self.set_pixel(x, y, color);
                }
            }
            for y in self.height - FONT_HEIGHT..self.height {
                for x in 0..self.width {
                    self.set_pixel(x, y, 0);
                }
            }
            self.y -= 1;
        }
    }
fn new_line ( & mut self ) { self . x = 0 ; self . y += 1 ; if self . y >= self . height / FONT_HEIGHT { // This is very slow, it would be better to have a buffer with the characters. // But this is only a debug output after all... for y in 0 .. self . height - FONT_HEIGHT { for x in 0 .. self . width { let color = self . get_pixel ( x , y + FONT_HEIGHT ) ; self . set_pixel ( x , y , color ) ; } } for y in self . height - FONT_HEIGHT .. self . height { for x in 0 .. self . width { self . set_pixel ( x , y , 0 ) ; } } self . y -= 1 ; } }
Goes to a new line and shifts the text up if required.
Goes to a new line and shifts the text up if required .
&mut self
&mut self