Skip to content
This repository has been archived by the owner on Nov 24, 2024. It is now read-only.

Commit

Permalink
Added a flag to prevent window dragging
Browse files Browse the repository at this point in the history
  • Loading branch information
valx76 committed Aug 7, 2021
1 parent 05d7b46 commit b960eca
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/microui.c
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ int mu_begin_window_ex(mu_Context *ctx, const char *title, mu_Rect rect, int opt
mu_Id id = mu_get_id(ctx, "!title", 6);
mu_update_control(ctx, id, tr, opt);
mu_draw_control_text(ctx, title, tr, MU_COLOR_TITLETEXT, opt);
if (id == ctx->focus && ctx->mouse_down == MU_MOUSE_LEFT) {
if (id == ctx->focus && ctx->mouse_down == MU_MOUSE_LEFT && ~opt & MU_OPT_NODRAG) {
cnt->rect.x += ctx->mouse_delta.x;
cnt->rect.y += ctx->mouse_delta.y;
}
Expand Down
3 changes: 2 additions & 1 deletion src/microui.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ enum {
MU_OPT_AUTOSIZE = (1 << 9),
MU_OPT_POPUP = (1 << 10),
MU_OPT_CLOSED = (1 << 11),
MU_OPT_EXPANDED = (1 << 12)
MU_OPT_EXPANDED = (1 << 12),
MU_OPT_NODRAG = (1 << 13)
};

enum {
Expand Down

0 comments on commit b960eca

Please sign in to comment.