diff --git a/demo/demo.c b/demo/demo.c index 0d1ee96..3bf5191 100644 --- a/demo/demo.c +++ b/demo/demo.c @@ -580,9 +580,9 @@ init_demo(struct demo_gui *gui, struct gui_font *font) gui_default_config(config); ratio.left = 0.10f; - ratio.right = 0.20f; + ratio.right = 0.40f; ratio.centerv = 0.9f; - ratio.centerh = 0.7f; + ratio.centerh = 0.5f; ratio.bottom = 0.05f; ratio.top = 0.05f; gui_layout_init(&gui->layout, &ratio); diff --git a/demo/opengl.c b/demo/opengl.c index 0df2ba2..b57a8cd 100644 --- a/demo/opengl.c +++ b/demo/opengl.c @@ -602,7 +602,8 @@ main(int argc, char *argv[]) /* Draw */ glClearColor(0.4f, 0.4f, 0.4f, 1.0f); glClear(GL_COLOR_BUFFER_BIT); - draw(&gui.stack, width, height); + draw(&gui.background, width, height); + draw(&gui.floating, width, height); SDL_GL_SwapWindow(win); /* Timing */ diff --git a/demo/win32.c b/demo/win32.c index 7403c45..dfe7ac5 100644 --- a/demo/win32.c +++ b/demo/win32.c @@ -448,6 +448,7 @@ WinMain(HINSTANCE hInstance, HINSTANCE prev, LPSTR lpCmdLine, int shown) surface_begin(xw.backbuffer); surface_clear(xw.backbuffer, 255, 255, 255); draw(xw.backbuffer, &gui.stack); + draw(xw.floating, &gui.stack); surface_end(xw.backbuffer, xw.hdc); /* Timing */ diff --git a/gui.c b/gui.c index 23e761c..f77bb03 100644 --- a/gui.c +++ b/gui.c @@ -1617,20 +1617,20 @@ gui_panel_hook_begin_tiled(struct gui_panel_layout *tile, struct gui_panel_hook if (index >= layout->capacity[slot]) return gui_false; panel = gui_hook_panel(hook); - panel->flags &= (gui_size)~GUI_PANEL_MINIMIZABLE; - panel->flags &= (gui_size)~GUI_PANEL_CLOSEABLE; - panel->flags &= (gui_size)~GUI_PANEL_MOVEABLE; - panel->flags &= (gui_size)~GUI_PANEL_SCALEABLE; + panel->flags &= (gui_flags)~GUI_PANEL_MINIMIZABLE; + panel->flags &= (gui_flags)~GUI_PANEL_CLOSEABLE; + panel->flags &= (gui_flags)~GUI_PANEL_MOVEABLE; + panel->flags &= (gui_flags)~GUI_PANEL_SCALEABLE; - bounds.x = layout->offset[slot].x * layout->width; - bounds.y = layout->offset[slot].y * layout->height; - bounds.w = layout->ratio[slot].x * layout->width; - bounds.h = layout->ratio[slot].y * layout->height; + bounds.x = layout->offset[slot].x * (gui_float)layout->width; + bounds.y = layout->offset[slot].y * (gui_float)layout->height; + bounds.w = layout->ratio[slot].x * (gui_float)layout->width; + bounds.h = layout->ratio[slot].y * (gui_float)layout->height; panel->x = bounds.x; panel->w = bounds.w; - panel->h = bounds.h / layout->capacity[slot]; - panel->y = bounds.y + index * panel->h; + panel->h = bounds.h / (gui_float)layout->capacity[slot]; + panel->y = bounds.y + (gui_float)index * panel->h; gui_stack_push(&layout->stack, hook); return gui_panel_begin(tile, panel, title, canvas, (layout->active) ? in : NULL); } diff --git a/gui.h b/gui.h index daddf06..c2a3048 100644 --- a/gui.h +++ b/gui.h @@ -542,7 +542,7 @@ void gui_buffer_end(struct gui_command_list*, struct gui_command_buffer*, #define gui_list_for_each(i, l) for (i = gui_list_begin(l); i != NULL; i = gui_list_next(l, i)) const struct gui_command* gui_list_begin(const struct gui_command_list*); const struct gui_command* gui_list_next(const struct gui_command_list*, - const struct gui_command*); + const struct gui_command*); /* Widgets */