From 741217af1faa70b679ce20795beb9a034a8dcb05 Mon Sep 17 00:00:00 2001 From: vurtun Date: Fri, 12 Feb 2016 20:59:49 +0100 Subject: [PATCH] Changed property dragging behavior for easier use Previously dragging was activated in properties by clicking on the label or value and edit mode by clicking inside the empty space. While it worked it was not as nice to use as intended. Now it dragging mode is activated by dragging on the empty space or label and edit mode by clicking on the label. --- zahnrad.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/zahnrad.c b/zahnrad.c index 1348a84..12245a1 100644 --- a/zahnrad.c +++ b/zahnrad.c @@ -5714,11 +5714,11 @@ zr_property_behavior(enum zr_widget_status *ws, const struct zr_input *in, value = CLAMP(min, value + step, max); if (*state == ZR_PROPERTY_DEFAULT) { - if (zr_button_behavior(ws, empty, in, ZR_BUTTON_DEFAULT)) + if (zr_button_behavior(ws, edit, in, ZR_BUTTON_DEFAULT)) *state = ZR_PROPERTY_EDIT; else if (zr_input_has_mouse_click_in_rect(in, ZR_BUTTON_LEFT, label)) *state = ZR_PROPERTY_DRAG; - else if (zr_input_has_mouse_click_in_rect(in, ZR_BUTTON_LEFT, edit)) + else if (zr_input_has_mouse_click_in_rect(in, ZR_BUTTON_LEFT, empty)) *state = ZR_PROPERTY_DRAG; } if (*state == ZR_PROPERTY_DRAG) { @@ -5763,10 +5763,9 @@ static float zr_do_property(enum zr_widget_status *ws, struct zr_command_buffer *out, struct zr_rect property, const char *name, float min, float val, float max, - float step, float inc_per_pixel, - char *buffer, zr_size *len, - int *state, zr_size *cursor, struct zr_property *p, - zr_filter filter, const struct zr_input *in, const struct zr_user_font *f) + float step, float inc_per_pixel, char *buffer, zr_size *len, + int *state, zr_size *cursor, struct zr_property *p, zr_filter filter, + const struct zr_input *in, const struct zr_user_font *f) { zr_size size; char string[ZR_MAX_NUMBER_BUFFER];