diff --git a/demo/demo.c b/demo/demo.c index 835c97b..7fe46ba 100644 --- a/demo/demo.c +++ b/demo/demo.c @@ -1,3 +1,9 @@ +#define MIN(a,b) ((a) < (b) ? (a) : (b)) +#define MAX(a,b) ((a) < (b) ? (b) : (a)) +#define CLAMP(i,v,x) (MAX(MIN(v,x), i)) +#define LEN(a) (sizeof(a)/sizeof(a)[0]) +#define UNUSED(a) ((void)(a)) + #define MAX_BUFFER 64 #define MAX_MEMORY (32 * 1024) #define MAX_COMMAND_MEMORY (16 * 1024) diff --git a/demo/nanovg/nanovg.c b/demo/nanovg/nanovg.c index 5c7a48c..20e5132 100644 --- a/demo/nanovg/nanovg.c +++ b/demo/nanovg/nanovg.c @@ -40,13 +40,6 @@ #include "dep/nanovg.c" /* macros */ -#define DTIME 33 -#define MIN(a,b) ((a) < (b) ? (a) : (b)) -#define MAX(a,b) ((a) < (b) ? (b) : (a)) -#define CLAMP(i,v,x) (MAX(MIN(v,x), i)) -#define LEN(a) (sizeof(a)/sizeof(a)[0]) -#define UNUSED(a) ((void)(a)) - #include "../../zahnrad.h" static void diff --git a/demo/opengl/opengl.c b/demo/opengl/opengl.c index e46b2df..c26ed4b 100644 --- a/demo/opengl/opengl.c +++ b/demo/opengl/opengl.c @@ -35,12 +35,6 @@ #define DTIME 33 #define MAX_DRAW_COMMAND_MEMORY (4 * 1024) -#define MIN(a,b) ((a) < (b) ? (a) : (b)) -#define MAX(a,b) ((a) < (b) ? (b) : (a)) -#define CLAMP(i,v,x) (MAX(MIN(v,x), i)) -#define LEN(a) (sizeof(a)/sizeof(a)[0]) -#define UNUSED(a) ((void)(a)) - #include "../../zahnrad.h" static void clipboard_set(const char *text){SDL_SetClipboardText(text);} diff --git a/demo/win32/win32.c b/demo/win32/win32.c index e37d77d..c8bc928 100644 --- a/demo/win32/win32.c +++ b/demo/win32/win32.c @@ -14,11 +14,6 @@ /* macros */ #define DTIME 16 -#define MIN(a,b) ((a) < (b) ? (a) : (b)) -#define MAX(a,b) ((a) < (b) ? (b) : (a)) -#define CLAMP(i,v,x) (MAX(MIN(v,x), i)) -#define LEN(a) (sizeof(a)/sizeof(a)[0]) -#define UNUSED(a) ((void)(a)) #include "../../zahnrad.h" diff --git a/demo/x11/xlib.c b/demo/x11/xlib.c index c472f09..357a96f 100644 --- a/demo/x11/xlib.c +++ b/demo/x11/xlib.c @@ -30,14 +30,9 @@ /* macros */ #define DTIME 16 -#define MIN(a,b) ((a) < (b) ? (a) : (b)) -#define MAX(a,b) ((a) < (b) ? (b) : (a)) -#define CLAMP(i,v,x) (MAX(MIN(v,x), i)) -#define LEN(a) (sizeof(a)/sizeof(a)[0]) -#define UNUSED(a) ((void)(a)) - #include "../../zahnrad.h" +#define UNUSED(a) ((void)(a)) static void clipboard_set(const char *text){UNUSED(text);} static zr_bool clipboard_is_filled(void){return zr_false;} static const char* clipboard_get(void) {return NULL;} diff --git a/zahnrad.c b/zahnrad.c index 90c9ac8..cf7180d 100644 --- a/zahnrad.c +++ b/zahnrad.c @@ -847,7 +847,6 @@ zr_input_is_key_down(const struct zr_input *i, enum zr_keys key) if (k->down) return zr_true; return zr_false; } - /* * ============================================================== * @@ -4571,8 +4570,6 @@ zr_widget_scrollbarh(struct zr_command_buffer *out, struct zr_rect scroll, if (target <= scroll.w) return 0; /* calculate scrollbar constants */ - scroll.w = scroll.w; - scroll.x = scroll.x; scroll_step = MIN(step, scroll.w); scroll_offset = MIN(offset, target - scroll.w); scroll_ratio = scroll.w / target; @@ -5270,6 +5267,7 @@ zr_begin(struct zr_context *context, struct zr_window *window) context->clip.x = window->bounds.x; context->clip.w = context->width; } + context->clip.y = window->bounds.y; context->clip.h = window->bounds.h - (context->footer_h + context->header.h); context->clip.h -= (window_padding.y + item_padding.y); diff --git a/zahnrad.h b/zahnrad.h index 1ee89f2..d31f106 100644 --- a/zahnrad.h +++ b/zahnrad.h @@ -40,7 +40,6 @@ extern "C" { /* defines the number of temporary configuration color changes that can be stored */ #define ZR_MAX_ATTRIB_STACK 32 /* defines the number of temporary configuration attribute changes that can be stored */ - /* * ============================================================== * @@ -3054,7 +3053,6 @@ void zr_menubar_begin(struct zr_context*); /* this function begins the window menubar build up process */ void zr_menubar_end(struct zr_context*); /* this function ends the window menubar build up process */ - /* -------------------------------------------------------------- * Layout * --------------------------------------------------------------