(self)
Draws a line from values stored in buffer.
Draws a line from values stored in buffer.
Draws a line from values stored in buffer .
def draw(self):
        """
        Draws a line from values stored in buffer.
        """
        if len(self.buffer) == 0:
            return

        if self.first_packet:
            self.y_offset = self.buffer[0][0]
            # print(self.y_offset)
            self.first_packet = False
        pos = self.x_offset, self.calc_y(self.buffer[0][0]) + self.y
        for i, (value, quality) in enumerate(self.buffer):
            y = self.calc_y(value) + self.y
            color = get_quality_scale_level_color(quality, self.old_model)
            pygame.draw.line(self.screen, color, pos, (self.x_offset + i, y))
            pos = (self.x_offset + i, y)
        self.screen.blit(self.text, self.text_pos)
def draw ( self ) : if len ( self . buffer ) == 0 : return if self . first_packet : self . y_offset = self . buffer [ 0 ] [ 0 ] # print(self.y_offset) self . first_packet = False pos = self . x_offset , self . calc_y ( self . buffer [ 0 ] [ 0 ] ) + self . y for i , ( value , quality ) in enumerate ( self . buffer ) : y = self . calc_y ( value ) + self . y color = get_quality_scale_level_color ( quality , self . old_model ) pygame . draw . line ( self . screen , color , pos , ( self . x_offset + i , y ) ) pos = ( self . x_offset + i , y ) self . screen . blit ( self . text , self . text_pos )