Merge branch 'diggit-nk_drag_fix'
This commit is contained in:
commit
38c8d54437
|
@ -15550,6 +15550,7 @@ nk_panel_begin(struct nk_context *ctx, const char *title, enum nk_panel_type pan
|
|||
/* window movement */
|
||||
if ((win->flags & NK_WINDOW_MOVABLE) && !(win->flags & NK_WINDOW_ROM)) {
|
||||
int left_mouse_down;
|
||||
int left_mouse_clicked;
|
||||
int left_mouse_click_in_cursor;
|
||||
|
||||
/* calculate draggable window space */
|
||||
|
@ -15564,9 +15565,10 @@ nk_panel_begin(struct nk_context *ctx, const char *title, enum nk_panel_type pan
|
|||
|
||||
/* window movement by dragging */
|
||||
left_mouse_down = in->mouse.buttons[NK_BUTTON_LEFT].down;
|
||||
left_mouse_clicked = (int)in->mouse.buttons[NK_BUTTON_LEFT].clicked;
|
||||
left_mouse_click_in_cursor = nk_input_has_mouse_click_down_in_rect(in,
|
||||
NK_BUTTON_LEFT, header, nk_true);
|
||||
if (left_mouse_down && left_mouse_click_in_cursor) {
|
||||
if (left_mouse_down && left_mouse_click_in_cursor && !left_mouse_clicked) {
|
||||
win->bounds.x = win->bounds.x + in->mouse.delta.x;
|
||||
win->bounds.y = win->bounds.y + in->mouse.delta.y;
|
||||
in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x += in->mouse.delta.x;
|
||||
|
|
|
@ -123,6 +123,7 @@ nk_panel_begin(struct nk_context *ctx, const char *title, enum nk_panel_type pan
|
|||
/* window movement */
|
||||
if ((win->flags & NK_WINDOW_MOVABLE) && !(win->flags & NK_WINDOW_ROM)) {
|
||||
int left_mouse_down;
|
||||
int left_mouse_clicked;
|
||||
int left_mouse_click_in_cursor;
|
||||
|
||||
/* calculate draggable window space */
|
||||
|
@ -137,9 +138,10 @@ nk_panel_begin(struct nk_context *ctx, const char *title, enum nk_panel_type pan
|
|||
|
||||
/* window movement by dragging */
|
||||
left_mouse_down = in->mouse.buttons[NK_BUTTON_LEFT].down;
|
||||
left_mouse_clicked = (int)in->mouse.buttons[NK_BUTTON_LEFT].clicked;
|
||||
left_mouse_click_in_cursor = nk_input_has_mouse_click_down_in_rect(in,
|
||||
NK_BUTTON_LEFT, header, nk_true);
|
||||
if (left_mouse_down && left_mouse_click_in_cursor) {
|
||||
if (left_mouse_down && left_mouse_click_in_cursor && !left_mouse_clicked) {
|
||||
win->bounds.x = win->bounds.x + in->mouse.delta.x;
|
||||
win->bounds.y = win->bounds.y + in->mouse.delta.y;
|
||||
in->mouse.buttons[NK_BUTTON_LEFT].clicked_pos.x += in->mouse.delta.x;
|
||||
|
|
Loading…
Reference in New Issue