diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 10 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_intern.h | 8 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_ops.c | 2 |
3 files changed, 14 insertions, 6 deletions
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 554bfa6fd3f..03a5b67149a 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -104,8 +104,12 @@ static void screen_delarea(bContext *C, bScreen *screen, ScrArea *area) MEM_freeN(area); } -ScrArea *area_split( - const wmWindow *win, bScreen *screen, ScrArea *area, char dir, float fac, int merge) +ScrArea *area_split(const wmWindow *win, + bScreen *screen, + ScrArea *area, + char dir, + const float fac, + const bool merge) { ScrArea *newa = NULL; @@ -484,7 +488,7 @@ static ScrArea *screen_area_trim( float fac = abs(size) / (float)(vertical ? ((*area)->v3->vec.x - (*area)->v1->vec.x) : ((*area)->v3->vec.y - (*area)->v1->vec.y)); fac = (reverse == vertical) ? 1.0f - fac : fac; - ScrArea *newsa = area_split(CTX_wm_window(C), screen, *area, vertical ? 'v' : 'h', fac, 1); + ScrArea *newsa = area_split(CTX_wm_window(C), screen, *area, vertical ? 'v' : 'h', fac, true); /* area_split always returns smallest of the two areas, so might have to swap. */ if (((fac > 0.5f) == vertical) != reverse) { diff --git a/source/blender/editors/screen/screen_intern.h b/source/blender/editors/screen/screen_intern.h index dd196f9621b..9fc8913f583 100644 --- a/source/blender/editors/screen/screen_intern.h +++ b/source/blender/editors/screen/screen_intern.h @@ -56,8 +56,12 @@ void screen_change_prepare(bScreen *screen_old, struct Main *bmain, struct bContext *C, wmWindow *win); -ScrArea *area_split( - const wmWindow *win, bScreen *screen, ScrArea *area, char dir, float fac, int merge); +ScrArea *area_split(const wmWindow *win, + bScreen *screen, + ScrArea *area, + char dir, + const float fac, + const bool merge); int screen_area_join(struct bContext *C, bScreen *screen, ScrArea *sa1, ScrArea *sa2); int area_getorientation(ScrArea *sa_a, ScrArea *sa_b); void area_getoffsets(ScrArea *sa_a, ScrArea *sa_b, const int dir, int *r_offset1, int *r_offset2); diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index eadc18de443..cfce4a34994 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -2092,7 +2092,7 @@ static bool area_split_apply(bContext *C, wmOperator *op) float fac = RNA_float_get(op->ptr, "factor"); int dir = RNA_enum_get(op->ptr, "direction"); - sd->narea = area_split(win, screen, sd->sarea, dir, fac, 0); /* 0 = no merge */ + sd->narea = area_split(win, screen, sd->sarea, dir, fac, false); /* false = no merge */ if (sd->narea == NULL) { return false; |