use api function for rect intersection
This commit is contained in:
@@ -410,11 +410,8 @@ void ED_region_do_draw(bContext *C, ARegion *ar)
|
||||
if (ar->drawrct.xmin == ar->drawrct.xmax)
|
||||
ar->drawrct = ar->winrct;
|
||||
else {
|
||||
/* extra clip for safety (intersect the rects, could use API func) */
|
||||
ar->drawrct.xmin = max_ii(ar->winrct.xmin, ar->drawrct.xmin);
|
||||
ar->drawrct.ymin = max_ii(ar->winrct.ymin, ar->drawrct.ymin);
|
||||
ar->drawrct.xmax = min_ii(ar->winrct.xmax, ar->drawrct.xmax);
|
||||
ar->drawrct.ymax = min_ii(ar->winrct.ymax, ar->drawrct.ymax);
|
||||
/* extra clip for safety */
|
||||
BLI_rcti_isect(&ar->winrct, &ar->drawrct, &ar->drawrct);
|
||||
}
|
||||
|
||||
/* note; this sets state, so we can use wmOrtho and friends */
|
||||
|
@@ -2953,10 +2953,8 @@ bool ED_view3d_calc_render_border(Scene *scene, View3D *v3d, ARegion *ar, rcti *
|
||||
rect->ymax = v3d->render_border.ymax * ar->winy;
|
||||
}
|
||||
|
||||
rect->xmin = CLAMPIS(ar->winrct.xmin + rect->xmin, ar->winrct.xmin, ar->winrct.xmax);
|
||||
rect->ymin = CLAMPIS(ar->winrct.ymin + rect->ymin, ar->winrct.ymin, ar->winrct.ymax);
|
||||
rect->xmax = CLAMPIS(ar->winrct.xmin + rect->xmax, ar->winrct.xmin, ar->winrct.xmax);
|
||||
rect->ymax = CLAMPIS(ar->winrct.ymin + rect->ymax, ar->winrct.ymin, ar->winrct.ymax);
|
||||
BLI_rcti_translate(rect, ar->winrct.xmin, ar->winrct.ymin);
|
||||
BLI_rcti_isect(&ar->winrct, rect, rect);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user