Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2014-01-04 10:16:19 +0400
committerCampbell Barton <ideasman42@gmail.com>2014-01-04 11:10:01 +0400
commitb9114cb609698bdd40175b79c017b8ec8d10b518 (patch)
tree98dc331711dcd06fb69f905ebdaf7937a4d23379 /source/blender/editors/interface/view2d.c
parent091740f858c1b6d3016e38fc3186cce737d9ff2c (diff)
UI: Use bool rather then int/short's where possible
Diffstat (limited to 'source/blender/editors/interface/view2d.c')
-rw-r--r--source/blender/editors/interface/view2d.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 39583551bec..e59106c265a 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -432,14 +432,14 @@ static void ui_view2d_curRect_validate_resize(View2D *v2d, int resize, int mask_
/* check if we should restore aspect ratio (if view size changed) */
if (v2d->keepzoom & V2D_KEEPASPECT) {
- short do_x = FALSE, do_y = FALSE, do_cur /* , do_win */ /* UNUSED */;
+ bool do_x = false, do_y = false, do_cur /* , do_win */ /* UNUSED */;
float /* curRatio, */ /* UNUSED */ winRatio;
/* when a window edge changes, the aspect ratio can't be used to
* find which is the best new 'cur' rect. thats why it stores 'old'
*/
- if (winx != v2d->oldwinx) do_x = TRUE;
- if (winy != v2d->oldwiny) do_y = TRUE;
+ if (winx != v2d->oldwinx) do_x = true;
+ if (winy != v2d->oldwiny) do_y = true;
/* curRatio = height / width; */ /* UNUSED */
winRatio = winy / winx;
@@ -448,14 +448,14 @@ static void ui_view2d_curRect_validate_resize(View2D *v2d, int resize, int mask_
if (do_x == do_y) {
if (do_x && do_y) {
/* here is 1,1 case, so all others must be 0,0 */
- if (ABS(winx - v2d->oldwinx) > ABS(winy - v2d->oldwiny)) do_y = FALSE;
- else do_x = FALSE;
+ if (fabsf(winx - v2d->oldwinx) > fabsf(winy - v2d->oldwiny)) do_y = false;
+ else do_x = false;
}
else if (winRatio > 1.0f) {
- do_x = FALSE;
+ do_x = false;
}
else {
- do_x = TRUE;
+ do_x = true;
}
}
do_cur = do_x;