Skip to content

Commit

Permalink
v5.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
RobLoach committed Jul 21, 2024
1 parent 6205a9e commit 663d67d
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.11)
project(raylib_nuklear
DESCRIPTION "raylib_nuklear: Nuklear immediate mode GUI for raylib."
HOMEPAGE_URL "https://github.com/robloach/raylib-nuklear"
VERSION 5.0.0
VERSION 5.0.1
LANGUAGES C
)

Expand Down
1 change: 1 addition & 0 deletions include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ add_library(raylib_nuklear INTERFACE)
target_include_directories(raylib_nuklear INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})
install(FILES
raylib-nuklear.h
raylib-nuklear-font.h
nuklear.h
DESTINATION include
)
16 changes: 9 additions & 7 deletions include/nuklear.h
Original file line number Diff line number Diff line change
Expand Up @@ -9694,14 +9694,16 @@ nk_draw_list_push_image(struct nk_draw_list *list, nk_handle texture)
struct nk_draw_command *prev = nk_draw_list_command_last(list);
if (prev->elem_count == 0) {
prev->texture = texture;
#ifdef NK_INCLUDE_COMMAND_USERDATA
#ifdef NK_INCLUDE_COMMAND_USERDATA
prev->userdata = list->userdata;
#endif
} else if (prev->texture.id != texture.id
#ifdef NK_INCLUDE_COMMAND_USERDATA
|| prev->userdata.id != list->userdata.id
#endif
) nk_draw_list_push_command(list, prev->clip_rect, texture);
#endif
} else if (prev->texture.id != texture.id
#ifdef NK_INCLUDE_COMMAND_USERDATA
|| prev->userdata.id != list->userdata.id
#endif
) {
nk_draw_list_push_command(list, prev->clip_rect, texture);
}
}
}
#ifdef NK_INCLUDE_COMMAND_USERDATA
Expand Down
4 changes: 2 additions & 2 deletions include/raylib-nuklear.h
Original file line number Diff line number Diff line change
Expand Up @@ -590,7 +590,7 @@ DrawNuklear(struct nk_context * ctx)
case NK_COMMAND_POLYGON: {
const struct nk_command_polygon *p = (const struct nk_command_polygon*)cmd;
Color color = ColorFromNuklear(p->color);
struct Vector2* points = (struct Vector2*)MemAlloc((p->point_count + 1) * (unsigned short)sizeof(Vector2));
struct Vector2* points = (struct Vector2*)MemAlloc((unsigned int)((size_t)(p->point_count + 1) * sizeof(Vector2)));
unsigned short i;
for (i = 0; i < p->point_count; i++) {
points[i].x = p->points[i].x * scale;
Expand All @@ -605,7 +605,7 @@ DrawNuklear(struct nk_context * ctx)
// TODO: Implement NK_COMMAND_POLYGON_FILLED
const struct nk_command_polygon_filled *p = (const struct nk_command_polygon_filled*)cmd;
Color color = ColorFromNuklear(p->color);
struct Vector2* points = (struct Vector2*)MemAlloc((p->point_count + 1) * (unsigned short)sizeof(Vector2));
struct Vector2* points = (struct Vector2*)MemAlloc((unsigned int)((size_t)(p->point_count + 1) * sizeof(Vector2)));
unsigned short i;
for (i = 0; i < p->point_count; i++) {
points[i].x = p->points[i].x * scale;
Expand Down

0 comments on commit 663d67d

Please sign in to comment.