diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-21 03:06:17 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-21 03:06:17 +0400 |
commit | 77f47799ddff99da672aa58e5d989237403e7707 (patch) | |
tree | 951fa8eb0d6853355b697cc262ed92ddd9dd7a83 /source/blender/editors/space_view3d | |
parent | 94ce9505a9bf07e3d2532c82a0b8396f7c9727b3 (diff) |
code cleanup: use BLI_RCT_SIZE macro
Diffstat (limited to 'source/blender/editors/space_view3d')
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_edit.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_select.c | 4 |
3 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 199a1751f9d..93f8457e7a3 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -2038,8 +2038,8 @@ void view3d_update_depths_rect(ARegion *ar, ViewDepths *d, rcti *rect) x = rect->xmin; y = rect->ymin; - w = rect->xmax - rect->xmin; - h = rect->ymax - rect->ymin; + w = BLI_RCT_SIZE_X(rect); + h = BLI_RCT_SIZE_Y(rect); if (w <= 0 || h <= 0) { if (d->depths) diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 4fe859adf45..6e0c598d0ce 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -383,9 +383,9 @@ static void calctrackballvec(rcti *rect, int mx, int my, float vec[3]) /* normalize x and y */ x = BLI_RCT_CENTER_X(rect) - mx; - x /= (float)((rect->xmax - rect->xmin) / 4); + x /= (float)(BLI_RCT_SIZE_X(rect) / 4); y = BLI_RCT_CENTER_Y(rect) - my; - y /= (float)((rect->ymax - rect->ymin) / 2); + y /= (float)(BLI_RCT_SIZE_Y(rect) / 2); d = sqrt(x * x + y * y); if (d < radius * (float)M_SQRT1_2) { /* Inside sphere */ @@ -2784,8 +2784,8 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op) } /* work out the ratios, so that everything selected fits when we zoom */ - xscale = ((rect.xmax - rect.xmin) / vb[0]); - yscale = ((rect.ymax - rect.ymin) / vb[1]); + xscale = (BLI_RCT_SIZE_X(&rect) / vb[0]); + yscale = (BLI_RCT_SIZE_Y(&rect) / vb[1]); new_dist *= maxf(xscale, yscale); /* zoom in as required, or as far as we can go */ diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index 8ef1b481143..49d7c9ba28c 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -654,8 +654,8 @@ int do_paintvert_box_select(ViewContext *vc, rcti *rect, int select, int extend) unsigned int *rt; int a, index; char *selar; - int sx = rect->xmax - rect->xmin + 1; - int sy = rect->ymax - rect->ymin + 1; + int sx = BLI_RCT_SIZE_X(rect) + 1; + int sy = BLI_RCT_SIZE_Y(rect) + 1; me = vc->obact->data; |