diff --git a/demo/opengl.c b/demo/opengl.c index 55c5c17e..eac874f7 100644 --- a/demo/opengl.c +++ b/demo/opengl.c @@ -196,7 +196,7 @@ main(int argc, char *argv[]) config.colors[GUI_COLOR_TEXT].g = 255; config.colors[GUI_COLOR_TEXT].b = 255; config.colors[GUI_COLOR_TEXT].a = 255; - panel = gui_panel_new(ctx, 50, 50, 500, 300, &config, font); + panel = gui_panel_new(ctx, 50, 50, 500, 320, &config, font); message = gui_panel_new(ctx, 150, 150, 200, 100, &config, font); color_panel = gui_panel_new(ctx, 250, 250, 400, 250, &config, font); diff --git a/gui.c b/gui.c index 6cb0e3bf..bdc778da 100644 --- a/gui.c +++ b/gui.c @@ -1602,15 +1602,15 @@ gui_panel_begin(struct gui_panel *panel, struct gui_draw_buffer *out, gui_draw_rectf(out, x, y, w, panel->header_height, *header); clip.x = x; clip.w = w; - clip.y = y + panel->header_height; - clip.h = h - panel->header_height; + clip.y = y + panel->header_height - 1; + clip.h = h - panel->header_height - 1; if (panel->flags & GUI_PANEL_SCROLLBAR) clip.h -= (config->panel_padding.y + config->item_padding.y); else clip.h = null_rect.h; } else { panel->header_height = config->panel_padding.y + config->item_padding.y; - clip.x = x; clip.y = y; - clip.w = w; clip.h = h; + clip.x = x; clip.y = y - 1; + clip.w = w; clip.h = h + 1; if (panel->flags & GUI_PANEL_SCROLLBAR) clip.h -= panel->header_height; else clip.h = null_rect.h; @@ -2870,7 +2870,7 @@ gui_end_panel(struct gui_context *ctx, struct gui_panel *panel, cpanel = (struct gui_context_panel*)panel; gui_panel_end(panel); - if (ctx->active == cpanel && (panel->flags & GUI_PANEL_SCALEABLE) && + if (!panel->minimized && ctx->active == cpanel && (panel->flags & GUI_PANEL_SCALEABLE) && (panel->flags & GUI_PANEL_SCROLLBAR)) { const struct gui_config *config = panel->config; struct gui_color col = config->colors[GUI_COLOR_SCALER];