diff --git a/nuklear.h b/nuklear.h index 98babbf..92ee962 100644 --- a/nuklear.h +++ b/nuklear.h @@ -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 = 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; diff --git a/src/nuklear_panel.c b/src/nuklear_panel.c index e9aa23d..60f5890 100644 --- a/src/nuklear_panel.c +++ b/src/nuklear_panel.c @@ -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 = 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;