diff options
Diffstat (limited to 'src/gui/window.c')
-rw-r--r-- | src/gui/window.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/gui/window.c b/src/gui/window.c index f56c8e6..3a75434 100644 --- a/src/gui/window.c +++ b/src/gui/window.c @@ -29,24 +29,24 @@ void window_init( window_t *window, widget_t *parent, const int x, const int y, window->dragging = false; - window->base.base.vtable = (widget_vtable_t *)&window_vtable; + ((widget_t *)window)->vtable = (widget_vtable_t *)&window_vtable; } void window_draw( void *obj, graphics_context_t *context ) { window_t *widget = obj; - if( widget->base.base.x < 0 ) { - widget->base.base.x = 0; + if( ((widget_t *)widget)->x < 0 ) { + ((widget_t *)widget)->x = 0; } - if( widget->base.base.x > context->mode.x - widget->base.base.w ) { - widget->base.base.x = context->mode.x - widget->base.base.w; + if( ((widget_t *)widget)->x > context->mode.x - ((widget_t *)widget)->w ) { + ((widget_t *)widget)->x = context->mode.x - ((widget_t *)widget)->w; } - if( widget->base.base.y < 0 ) { - widget->base.base.y = 0; + if( ((widget_t *)widget)->y < 0 ) { + ((widget_t *)widget)->y = 0; } - if( widget->base.base.y > context->mode.y - widget->base.base.h ) { - widget->base.base.y = context->mode.y - widget->base.base.h; + if( ((widget_t *)widget)->y > context->mode.y - ((widget_t *)widget)->h ) { + ((widget_t *)widget)->y = context->mode.y - ((widget_t *)widget)->h; } composite_widget_draw( obj, context ); @@ -73,7 +73,7 @@ void window_on_mouse_move( void *obj, const int old_x, const int old_y, const in window_t *widget = obj; if( widget->dragging ) { - widget->base.base.x += x - old_x; - widget->base.base.y += y - old_y; + ((widget_t *)widget)->x += x - old_x; + ((widget_t *)widget)->y += y - old_y; } } |