Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions nuklear.h
Original file line number Diff line number Diff line change
Expand Up @@ -21264,15 +21264,12 @@ nk_layout_row_calculate_usable_space(const struct nk_style *style, enum nk_panel
float panel_space;

struct nk_vec2 spacing;
struct nk_vec2 padding;

spacing = style->window.spacing;
padding = nk_panel_get_padding(style, type);

/* calculate the usable panel space */
panel_padding = 2 * padding.x;
panel_spacing = (float)NK_MAX(columns - 1, 0) * spacing.x;
panel_space = total_space - panel_padding - panel_spacing;
panel_space = total_space - panel_spacing;
return panel_space;
}
NK_LIB void
Expand Down Expand Up @@ -21816,7 +21813,6 @@ nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx,
NK_ASSERT(bounds);

spacing = style->window.spacing;
padding = nk_panel_get_padding(style, layout->type);
panel_space = nk_layout_row_calculate_usable_space(&ctx->style, layout->type,
layout->bounds.w, layout->row.columns);

Expand Down Expand Up @@ -21921,7 +21917,7 @@ nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx,
bounds->w = item_width;
bounds->h = layout->row.height - spacing.y;
bounds->y = layout->at_y - (float)*layout->offset_y;
bounds->x = layout->at_x + item_offset + item_spacing + padding.x;
bounds->x = layout->at_x + item_offset + item_spacing;
if (((bounds->x + bounds->w) > layout->max_x) && modify)
layout->max_x = bounds->x + bounds->w;
bounds->x -= (float)*layout->offset_x;
Expand Down Expand Up @@ -29114,6 +29110,7 @@ nk_tooltipfv(struct nk_context *ctx, const char *fmt, va_list args)
/// - [yy]: Minor version with non-breaking API and library changes
/// - [zz]: Bug fix version with no direct changes to API
///
/// - 2020/03/06 (4.01.7) - Fix bug where width padding was applied twice
/// - 2020/02/06 (4.01.6) - Update stb_truetype.h and stb_rect_pack.h and separate them
/// - 2019/12/10 (4.01.5) - Fix off-by-one error in NK_INTERSECT
/// - 2019/10/09 (4.01.4) - Fix bug for autoscrolling in nk_do_edit
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "nuklear",
"version": "4.01.6",
"version": "4.01.7",
"repo": "Immediate-Mode-UI/Nuklear",
"description": "A small ANSI C gui toolkit",
"keywords": ["gl", "ui", "toolkit"],
Expand Down
1 change: 1 addition & 0 deletions src/CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
/// - [yy]: Minor version with non-breaking API and library changes
/// - [zz]: Bug fix version with no direct changes to API
///
/// - 2020/03/06 (4.01.7) - Fix bug where width padding was applied twice
/// - 2020/02/06 (4.01.6) - Update stb_truetype.h and stb_rect_pack.h and separate them
/// - 2019/12/10 (4.01.5) - Fix off-by-one error in NK_INTERSECT
/// - 2019/10/09 (4.01.4) - Fix bug for autoscrolling in nk_do_edit
Expand Down
8 changes: 2 additions & 6 deletions src/nuklear_layout.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,12 @@ nk_layout_row_calculate_usable_space(const struct nk_style *style, enum nk_panel
float panel_space;

struct nk_vec2 spacing;
struct nk_vec2 padding;

spacing = style->window.spacing;
padding = nk_panel_get_padding(style, type);

/* calculate the usable panel space */
panel_padding = 2 * padding.x;
panel_spacing = (float)NK_MAX(columns - 1, 0) * spacing.x;
panel_space = total_space - panel_padding - panel_spacing;
panel_space = total_space - panel_spacing;
return panel_space;
}
NK_LIB void
Expand Down Expand Up @@ -601,7 +598,6 @@ nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx,
NK_ASSERT(bounds);

spacing = style->window.spacing;
padding = nk_panel_get_padding(style, layout->type);
panel_space = nk_layout_row_calculate_usable_space(&ctx->style, layout->type,
layout->bounds.w, layout->row.columns);

Expand Down Expand Up @@ -706,7 +702,7 @@ nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx,
bounds->w = item_width;
bounds->h = layout->row.height - spacing.y;
bounds->y = layout->at_y - (float)*layout->offset_y;
bounds->x = layout->at_x + item_offset + item_spacing + padding.x;
bounds->x = layout->at_x + item_offset + item_spacing;
if (((bounds->x + bounds->w) > layout->max_x) && modify)
layout->max_x = bounds->x + bounds->w;
bounds->x -= (float)*layout->offset_x;
Expand Down