From f9c0977f3586684a4b3ee8f235b2576bb8c57b3e Mon Sep 17 00:00:00 2001 From: Maxim Kasperski <35467995+Lusted4ever@users.noreply.github.com> Date: Thu, 30 Aug 2018 12:30:19 +0300 Subject: [PATCH] Update nuklear_layout.c --- src/nuklear_layout.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/nuklear_layout.c b/src/nuklear_layout.c index de0cf93..d179e58 100644 --- a/src/nuklear_layout.c +++ b/src/nuklear_layout.c @@ -605,21 +605,21 @@ nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx, panel_space = nk_layout_row_calculate_usable_space(&ctx->style, layout->type, layout->bounds.w, layout->row.columns); - #define FRAC(x) (x - (int)x) /* will be used to remove fookin gaps */ + #define NK_FRAC(x) (x - (int)x) /* will be used to remove fookin gaps */ /* calculate the width of one item inside the current layout space */ switch (layout->row.type) { case NK_LAYOUT_DYNAMIC_FIXED: { /* scaling fixed size widgets item width */ float w = NK_MAX(1.0f,panel_space) / (float)layout->row.columns; item_offset = (float)layout->row.index * w; - item_width = w + FRAC(item_offset); + item_width = w + NK_FRAC(item_offset); item_spacing = (float)layout->row.index * spacing.x; } break; case NK_LAYOUT_DYNAMIC_ROW: { /* scaling single ratio widget width */ float w = layout->row.item_width * panel_space; item_offset = layout->row.item_offset; - item_width = w + FRAC(item_offset); + item_width = w + NK_FRAC(item_offset); item_spacing = 0; if (modify) { @@ -634,8 +634,8 @@ nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx, bounds->x -= (float)*layout->offset_x; bounds->y = layout->at_y + (layout->row.height * layout->row.item.y); bounds->y -= (float)*layout->offset_y; - bounds->w = layout->bounds.w * layout->row.item.w + FRAC(bounds->x); - bounds->h = layout->row.height * layout->row.item.h + FRAC(bounds->y); + bounds->w = layout->bounds.w * layout->row.item.w + NK_FRAC(bounds->x); + bounds->h = layout->row.height * layout->row.item.h + NK_FRAC(bounds->y); return; } case NK_LAYOUT_DYNAMIC: { @@ -648,7 +648,7 @@ nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx, w = (ratio * panel_space); item_spacing = (float)layout->row.index * spacing.x; item_offset = layout->row.item_offset; - item_width = w + FRAC(item_offset); + item_width = w + NK_FRAC(item_offset); if (modify) { layout->row.item_offset += w; @@ -694,11 +694,11 @@ nk_layout_widget_space(struct nk_rect *bounds, const struct nk_context *ctx, NK_ASSERT(layout->row.index < NK_MAX_LAYOUT_ROW_TEMPLATE_COLUMNS); w = layout->row.templates[layout->row.index]; item_offset = layout->row.item_offset; - item_width = w + FRAC(item_offset); + item_width = w + NK_FRAC(item_offset); item_spacing = (float)layout->row.index * spacing.x; if (modify) layout->row.item_offset += w; } break; - #undef FRAC + #undef NK_FRAC default: NK_ASSERT(0); break; };