diff options
author | Ton Roosendaal <ton@blender.org> | 2012-12-15 13:45:34 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2012-12-15 13:45:34 +0400 |
commit | 35dd893c368548b5d9d7bb56a1b9db07c71165d2 (patch) | |
tree | 23b7110625520b64e9e247e498704fa84629ae1c /source/blender | |
parent | 81d240c8c86d0741e26eaa3f8b4b4c9bfac38f1a (diff) |
Bugfix, irc collection:
With larger header sizes (via DPI setting), splitting an area horizontally (using
left-bottom corner widget, move up) stopped immediate after split, not allowing
to drag it to a position.
Culprit was code to check minimum header size, and area operator using the same
flags. Now ScrVert has two flags - one for internal use, one for the tools to set.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/screen/area.c | 2 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 18 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_screen_types.h | 3 |
3 files changed, 12 insertions, 11 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 62ddd10ee7c..a73c2d818d0 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1139,7 +1139,7 @@ static void region_rect_recursive(wmWindow *win, ScrArea *sa, ARegion *ar, rcti static void area_calc_totrct(ScrArea *sa, int sizex, int sizey) { - short rt = U.pixelsize > 1 ? 1 : 0; + short rt = U.pixelsize > 1.0f ? 1 : 0; if (sa->v1->vec.x > 0) sa->totrct.xmin = sa->v1->vec.x + 1 + rt; else sa->totrct.xmin = sa->v1->vec.x; diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 6e65d7fa59a..2e6cb420974 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -977,18 +977,18 @@ static void area_move_set_limits(bScreen *sc, int dir, int *bigger, int *smaller int y1 = sa->v2->vec.y - sa->v1->vec.y - areaminy; /* if top or down edge selected, test height */ - if (sa->v1->flag && sa->v4->flag) + if (sa->v1->editflag && sa->v4->editflag) *bigger = min_ii(*bigger, y1); - else if (sa->v2->flag && sa->v3->flag) + else if (sa->v2->editflag && sa->v3->editflag) *smaller = min_ii(*smaller, y1); } else { int x1 = sa->v4->vec.x - sa->v1->vec.x - AREAMINX; /* if left or right edge selected, test width */ - if (sa->v1->flag && sa->v2->flag) + if (sa->v1->editflag && sa->v2->editflag) *bigger = min_ii(*bigger, x1); - else if (sa->v3->flag && sa->v4->flag) + else if (sa->v3->editflag && sa->v4->editflag) *smaller = min_ii(*smaller, x1); } } @@ -1038,7 +1038,7 @@ static void area_move_apply_do(bContext *C, int origval, int delta, int dir, int delta = CLAMPIS(delta, -smaller, bigger); for (v1 = sc->vertbase.first; v1; v1 = v1->next) { - if (v1->flag) { + if (v1->editflag) { /* that way a nice AREAGRID */ if ((dir == 'v') && v1->vec.x > 0 && v1->vec.x < WM_window_pixels_x(win) - 1) { v1->vec.x = origval + delta; @@ -1058,7 +1058,7 @@ static void area_move_apply_do(bContext *C, int origval, int delta, int dir, int } for (sa = sc->areabase.first; sa; sa = sa->next) { - if (sa->v1->flag || sa->v2->flag || sa->v3->flag || sa->v4->flag) + if (sa->v1->editflag || sa->v2->editflag || sa->v3->editflag || sa->v4->editflag) ED_area_tag_redraw(sa); } @@ -1336,10 +1336,10 @@ static int area_split_apply(bContext *C, wmOperator *op) /* select newly created edge, prepare for moving edge */ for (sv = sc->vertbase.first; sv; sv = sv->next) - sv->flag = 0; + sv->editflag = 0; - sd->nedge->v1->flag = 1; - sd->nedge->v2->flag = 1; + sd->nedge->v1->editflag = 1; + sd->nedge->v2->editflag = 1; if (dir == 'h') sd->origval = sd->nedge->v1->vec.y; else sd->origval = sd->nedge->v1->vec.x; diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index ed2ffdf6702..de6ddb4b896 100644 --- a/source/blender/makesdna/DNA_screen_types.h +++ b/source/blender/makesdna/DNA_screen_types.h @@ -82,7 +82,8 @@ typedef struct bScreen { typedef struct ScrVert { struct ScrVert *next, *prev, *newv; vec2s vec; - int flag; + /* first one used internally, second one for tools */ + short flag, editflag; } ScrVert; typedef struct ScrEdge { |