fix for header/imp usage
Signed-off-by: 倪庆亮 <qingliang.ni@magewell.com>
This commit is contained in:
parent
65dd91bed2
commit
151fceb45d
|
@ -298,6 +298,10 @@ nk_combo_begin_symbol(struct nk_context *ctx, enum nk_symbol_type symbol, struct
|
||||||
nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color);
|
nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color);
|
||||||
nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color);
|
nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
NK_ASSERT(0);
|
||||||
|
sym_background = nk_rgba(0, 0, 0, 0);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
struct nk_rect bounds = {0,0,0,0};
|
struct nk_rect bounds = {0,0,0,0};
|
||||||
|
@ -395,6 +399,10 @@ nk_combo_begin_symbol_text(struct nk_context *ctx, const char *selected, int len
|
||||||
nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color);
|
nk_fill_rect(&win->buffer, header, style->combo.rounding, background->data.color);
|
||||||
nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color);
|
nk_stroke_rect(&win->buffer, header, style->combo.rounding, style->combo.border, style->combo.border_color);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
NK_ASSERT(0);
|
||||||
|
text.background = nk_rgba(0, 0, 0, 0);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
struct nk_rect content;
|
struct nk_rect content;
|
||||||
|
|
|
@ -121,15 +121,21 @@ NK_LIB int nk_to_upper(int c);
|
||||||
NK_LIB int nk_to_lower(int c);
|
NK_LIB int nk_to_lower(int c);
|
||||||
|
|
||||||
#ifndef NK_MEMCPY
|
#ifndef NK_MEMCPY
|
||||||
|
#define NK_MEMCPY_IMP
|
||||||
|
#define NK_MEMCPY nk_memcopy
|
||||||
NK_LIB void* nk_memcopy(void *dst, const void *src, nk_size n);
|
NK_LIB void* nk_memcopy(void *dst, const void *src, nk_size n);
|
||||||
#endif
|
#endif
|
||||||
#ifndef NK_MEMSET
|
#ifndef NK_MEMSET
|
||||||
|
#define NK_MEMSET_IMP
|
||||||
|
#define NK_MEMSET nk_memset
|
||||||
NK_LIB void nk_memset(void *ptr, int c0, nk_size size);
|
NK_LIB void nk_memset(void *ptr, int c0, nk_size size);
|
||||||
#endif
|
#endif
|
||||||
NK_LIB void nk_zero(void *ptr, nk_size size);
|
NK_LIB void nk_zero(void *ptr, nk_size size);
|
||||||
NK_LIB char *nk_itoa(char *s, long n);
|
NK_LIB char *nk_itoa(char *s, long n);
|
||||||
NK_LIB int nk_string_float_limit(char *string, int prec);
|
NK_LIB int nk_string_float_limit(char *string, int prec);
|
||||||
#ifndef NK_DTOA
|
#ifndef NK_DTOA
|
||||||
|
#define NK_DTOA_IMP
|
||||||
|
#define NK_DTOA nk_dtoa
|
||||||
NK_LIB char *nk_dtoa(char *s, double n);
|
NK_LIB char *nk_dtoa(char *s, double n);
|
||||||
#endif
|
#endif
|
||||||
NK_LIB int nk_text_clamp(const struct nk_user_font *font, const char *text, int text_len, float space, int *glyphs, float *text_width, nk_rune *sep_list, int sep_count);
|
NK_LIB int nk_text_clamp(const struct nk_user_font *font, const char *text, int text_len, float space, int *glyphs, float *text_width, nk_rune *sep_list, int sep_count);
|
||||||
|
|
|
@ -55,6 +55,10 @@ nk_draw_selectable(struct nk_command_buffer *out,
|
||||||
text.background = background->data.color;
|
text.background = background->data.color;
|
||||||
nk_fill_rect(out, *bounds, style->rounding, background->data.color);
|
nk_fill_rect(out, *bounds, style->rounding, background->data.color);
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
NK_ASSERT(0);
|
||||||
|
text.background = nk_rgba(0, 0, 0, 0);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if (icon) {
|
if (icon) {
|
||||||
if (img) nk_draw_image(out, *icon, img, nk_white);
|
if (img) nk_draw_image(out, *icon, img, nk_white);
|
||||||
|
|
|
@ -13,8 +13,7 @@ NK_LIB nk_bool nk_is_upper(int c){return (c >= 'A' && c <= 'Z') || (c >= 0xC0 &&
|
||||||
NK_LIB int nk_to_upper(int c) {return (c >= 'a' && c <= 'z') ? (c - ('a' - 'A')) : c;}
|
NK_LIB int nk_to_upper(int c) {return (c >= 'a' && c <= 'z') ? (c - ('a' - 'A')) : c;}
|
||||||
NK_LIB int nk_to_lower(int c) {return (c >= 'A' && c <= 'Z') ? (c - ('a' + 'A')) : c;}
|
NK_LIB int nk_to_lower(int c) {return (c >= 'A' && c <= 'Z') ? (c - ('a' + 'A')) : c;}
|
||||||
|
|
||||||
#ifndef NK_MEMCPY
|
#ifdef NK_MEMCPY_IMP
|
||||||
#define NK_MEMCPY nk_memcopy
|
|
||||||
NK_LIB void*
|
NK_LIB void*
|
||||||
nk_memcopy(void *dst0, const void *src0, nk_size length)
|
nk_memcopy(void *dst0, const void *src0, nk_size length)
|
||||||
{
|
{
|
||||||
|
@ -72,8 +71,7 @@ done:
|
||||||
return (dst0);
|
return (dst0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#ifndef NK_MEMSET
|
#ifdef NK_MEMSET_IMP
|
||||||
#define NK_MEMSET nk_memset
|
|
||||||
NK_LIB void
|
NK_LIB void
|
||||||
nk_memset(void *ptr, int c0, nk_size size)
|
nk_memset(void *ptr, int c0, nk_size size)
|
||||||
{
|
{
|
||||||
|
@ -499,8 +497,7 @@ nk_itoa(char *s, long n)
|
||||||
nk_strrev_ascii(s);
|
nk_strrev_ascii(s);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
#ifndef NK_DTOA
|
#ifdef NK_DTOA_IMP
|
||||||
#define NK_DTOA nk_dtoa
|
|
||||||
NK_LIB char*
|
NK_LIB char*
|
||||||
nk_dtoa(char *s, double n)
|
nk_dtoa(char *s, double n)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue