@@ -9216,6 +9216,7 @@ NK_API void
92169216nk_draw_nine_slice(struct nk_command_buffer *b, struct nk_rect r,
92179217 const struct nk_nine_slice *slc, struct nk_color col)
92189218{
9219+ struct nk_image img;
92199220 const struct nk_image *slcimg = (const struct nk_image*)slc;
92209221 nk_ushort rgnX, rgnY, rgnW, rgnH;
92219222 rgnX = slcimg->region[0];
@@ -9224,8 +9225,14 @@ nk_draw_nine_slice(struct nk_command_buffer *b, struct nk_rect r,
92249225 rgnH = slcimg->region[3];
92259226
92269227 /* top-left */
9227- struct nk_image img = {slcimg->handle, slcimg->w, slcimg->h,
9228- {rgnX, rgnY, slc->l, slc->t}};
9228+ img.handle = slcimg->handle;
9229+ img.w = slcimg->w;
9230+ img.h = slcimg->h;
9231+ img.region[0] = rgnX;
9232+ img.region[1] = rgnY;
9233+ img.region[2] = slc->l;
9234+ img.region[3] = slc->t;
9235+
92299236 nk_draw_image(b,
92309237 nk_rect(r.x, r.y, (float)slc->l, (float)slc->t),
92319238 &img, col);
@@ -23483,8 +23490,8 @@ NK_API struct nk_nine_slice
2348323490nk_sub9slice_ptr(void *ptr, nk_ushort w, nk_ushort h, struct nk_rect rgn, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b)
2348423491{
2348523492 struct nk_nine_slice s;
23486- nk_zero(&s, sizeof(s));
2348723493 struct nk_image *i = &s.img;
23494+ nk_zero(&s, sizeof(s));
2348823495 i->handle.ptr = ptr;
2348923496 i->w = w; i->h = h;
2349023497 i->region[0] = (nk_ushort)rgn.x;
@@ -23498,8 +23505,8 @@ NK_API struct nk_nine_slice
2349823505nk_sub9slice_id(int id, nk_ushort w, nk_ushort h, struct nk_rect rgn, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b)
2349923506{
2350023507 struct nk_nine_slice s;
23501- nk_zero(&s, sizeof(s));
2350223508 struct nk_image *i = &s.img;
23509+ nk_zero(&s, sizeof(s));
2350323510 i->handle.id = id;
2350423511 i->w = w; i->h = h;
2350523512 i->region[0] = (nk_ushort)rgn.x;
@@ -23513,8 +23520,8 @@ NK_API struct nk_nine_slice
2351323520nk_sub9slice_handle(nk_handle handle, nk_ushort w, nk_ushort h, struct nk_rect rgn, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b)
2351423521{
2351523522 struct nk_nine_slice s;
23516- nk_zero(&s, sizeof(s));
2351723523 struct nk_image *i = &s.img;
23524+ nk_zero(&s, sizeof(s));
2351823525 i->handle = handle;
2351923526 i->w = w; i->h = h;
2352023527 i->region[0] = (nk_ushort)rgn.x;
@@ -23528,8 +23535,8 @@ NK_API struct nk_nine_slice
2352823535nk_nine_slice_handle(nk_handle handle, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b)
2352923536{
2353023537 struct nk_nine_slice s;
23531- nk_zero(&s, sizeof(s));
2353223538 struct nk_image *i = &s.img;
23539+ nk_zero(&s, sizeof(s));
2353323540 i->handle = handle;
2353423541 i->w = 0; i->h = 0;
2353523542 i->region[0] = 0;
@@ -23543,8 +23550,8 @@ NK_API struct nk_nine_slice
2354323550nk_nine_slice_ptr(void *ptr, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b)
2354423551{
2354523552 struct nk_nine_slice s;
23546- nk_zero(&s, sizeof(s));
2354723553 struct nk_image *i = &s.img;
23554+ nk_zero(&s, sizeof(s));
2354823555 NK_ASSERT(ptr);
2354923556 i->handle.ptr = ptr;
2355023557 i->w = 0; i->h = 0;
@@ -23559,8 +23566,8 @@ NK_API struct nk_nine_slice
2355923566nk_nine_slice_id(int id, nk_ushort l, nk_ushort t, nk_ushort r, nk_ushort b)
2356023567{
2356123568 struct nk_nine_slice s;
23562- nk_zero(&s, sizeof(s));
2356323569 struct nk_image *i = &s.img;
23570+ nk_zero(&s, sizeof(s));
2356423571 i->handle.id = id;
2356523572 i->w = 0; i->h = 0;
2356623573 i->region[0] = 0;
0 commit comments