@@ -87,18 +87,26 @@ static void plot_char_unscaled_canvas(struct flanterm_context *_ctx, struct flan
8787 return ;
8888 }
8989
90+ uint32_t default_bg = ctx -> default_bg ;
91+
92+ uint32_t bg = c -> bg == 0xffffffff ? default_bg : c -> bg ;
93+ uint32_t fg = c -> fg == 0xffffffff ? default_bg : c -> fg ;
94+
9095 x = ctx -> offset_x + x * ctx -> glyph_width ;
9196 y = ctx -> offset_y + y * ctx -> glyph_height ;
9297
9398 bool * glyph = & ctx -> font_bool [c -> c * ctx -> font_height * ctx -> font_width ];
9499 // naming: fx,fy for font coordinates, gx,gy for glyph coordinates
100+ if (ft_min_y == -1 || ft_min_y > (int64_t ) y ) {
101+ ft_min_y = (int64_t ) y ;
102+ }
103+ if (ft_max_y == -1 || ft_max_y < (int64_t ) (y + ctx -> glyph_height )) {
104+ ft_max_y = (int64_t ) (y + ctx -> glyph_height );
105+ }
95106 for (size_t gy = 0 ; gy < ctx -> glyph_height ; gy ++ ) {
96107 volatile uint32_t * fb_line = ctx -> framebuffer + x + (y + gy ) * (ctx -> pitch / 4 );
97- uint32_t * canvas_line = ctx -> canvas + x + (y + gy ) * ctx -> width ;
98108 bool * glyph_pointer = glyph + (gy * ctx -> font_width );
99109 for (size_t fx = 0 ; fx < ctx -> font_width ; fx ++ ) {
100- uint32_t bg = c -> bg == 0xffffffff ? canvas_line [fx ] : c -> bg ;
101- uint32_t fg = c -> fg == 0xffffffff ? canvas_line [fx ] : c -> fg ;
102110 fb_line [fx ] = * (glyph_pointer ++ ) ? fg : bg ;
103111 }
104112 }
@@ -421,7 +429,6 @@ static void flanterm_fb_full_refresh(struct flanterm_context *_ctx) {
421429 for (size_t i = 0 ; i < (size_t ) _ctx -> rows * _ctx -> cols ; i ++ ) {
422430 size_t x = i % _ctx -> cols ;
423431 size_t y = i / _ctx -> cols ;
424-
425432 ctx -> plot_char (_ctx , & ctx -> grid [i ], x , y );
426433 }
427434
0 commit comments