diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text_widget.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/gui/text_widget.c b/src/gui/text_widget.c index 6071fd1..64bf161 100644 --- a/src/gui/text_widget.c +++ b/src/gui/text_widget.c @@ -40,16 +40,18 @@ void text_widget_draw( void *obj, graphics_context_t *context ) int x = 0; int y = 0; + int w = 0; + int h = 0; widget->base.vtable->model_to_screen( widget, &x, &y ); for( const char *p = widget->s; *p != '\0'; p++ ) { - vga_draw_char( context, *p, x, y, widget->base.background_color, + vga_draw_char( context, *p, x + w, y + h, widget->base.background_color, VGA_COLOR_WHITE ); - x += 9; - if( x >= widget->base.w - 9 ) { - y += 16; - x = 0; + w += 9; + if( w >= widget->base.w - 9 ) { + h += 16; + w = 0; } } |