@@ -22034,14 +22034,16 @@ nk_layout_row_calculate_usable_space(const struct nk_style *style, enum nk_panel
22034
22034
float panel_space;
22035
22035
22036
22036
struct nk_vec2 spacing;
22037
+ struct nk_vec2 padding;
22037
22038
22038
22039
NK_UNUSED(type);
22039
22040
22040
22041
spacing = style->window.spacing;
22042
+ padding = nk_panel_get_padding(style, type);
22041
22043
22042
22044
/* calculate the usable panel space */
22043
22045
panel_spacing = (float)NK_MAX(columns - 1, 0) * spacing.x;
22044
- panel_space = total_space - panel_spacing;
22046
+ panel_space = total_space - (2 * padding.x) - panel_spacing;
22045
22047
return panel_space;
22046
22048
}
22047
22049
NK_LIB void
@@ -22565,6 +22567,7 @@ nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx,
22565
22567
struct nk_panel *layout;
22566
22568
const struct nk_style *style;
22567
22569
22570
+ struct nk_vec2 padding;
22568
22571
struct nk_vec2 spacing;
22569
22572
22570
22573
float item_offset = 0;
@@ -22584,6 +22587,7 @@ nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx,
22584
22587
NK_ASSERT(bounds);
22585
22588
22586
22589
spacing = style->window.spacing;
22590
+ padding = nk_panel_get_padding(style, layout->type);
22587
22591
panel_space = nk_layout_row_calculate_usable_space(&ctx->style, layout->type,
22588
22592
layout->bounds.w, layout->row.columns);
22589
22593
@@ -22688,7 +22692,7 @@ nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx,
22688
22692
bounds->w = item_width;
22689
22693
bounds->h = layout->row.height - spacing.y;
22690
22694
bounds->y = layout->at_y - (float)*layout->offset_y;
22691
- bounds->x = layout->at_x + item_offset + item_spacing;
22695
+ bounds->x = layout->at_x + item_offset + item_spacing + padding.x ;
22692
22696
if (((bounds->x + bounds->w) > layout->max_x) && modify)
22693
22697
layout->max_x = bounds->x + bounds->w;
22694
22698
bounds->x -= (float)*layout->offset_x;
0 commit comments