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>2012-05-04 01:35:04 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-05-04 01:35:04 +0400
commit5da2135eef39ac042a8c4babcac7be375e6903d2 (patch)
tree520282b4cae162503de17481cfbfbe43a93ed073 /source/blender/editors/space_view3d/view3d_draw.c
parentb075765edd9e8f18b088faf1a55358d0f8a289cd (diff)
code cleanup: double promotion & some style cleanup
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_draw.c')
-rw-r--r--source/blender/editors/space_view3d/view3d_draw.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c
index ec383e1dbdb..e1828bbef32 100644
--- a/source/blender/editors/space_view3d/view3d_draw.c
+++ b/source/blender/editors/space_view3d/view3d_draw.c
@@ -313,15 +313,15 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
double scalar = bUnit_GetScaler(usys, i);
dx_scalar = dx * scalar / unit->scale_length;
- if (dx_scalar < (GRID_MIN_PX * 2))
+ if (dx_scalar < (GRID_MIN_PX * 2.0))
continue;
/* Store the smallest drawn grid size units name so users know how big each grid cell is */
if (*grid_unit == NULL) {
*grid_unit = bUnit_GetNameDisplay(usys, i);
- rv3d->gridview = (scalar * v3d->grid) / unit->scale_length;
+ rv3d->gridview = (float)((scalar * v3d->grid) / (double)unit->scale_length);
}
- blend_fac = 1 - ((GRID_MIN_PX * 2) / dx_scalar);
+ blend_fac = 1.0f - ((GRID_MIN_PX * 2.0f) / (float)dx_scalar);
/* tweak to have the fade a bit nicer */
blend_fac = (blend_fac * blend_fac) * 2.0f;
@@ -355,7 +355,7 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
}
}
else { // start blending out
- UI_ThemeColorBlend(TH_BACK, TH_GRID, dx / (GRID_MIN_PX * 6));
+ UI_ThemeColorBlend(TH_BACK, TH_GRID, dx / (GRID_MIN_PX * 6.0f));
drawgrid_draw(ar, wx, wy, x, y, dx);
UI_ThemeColor(TH_GRID);
@@ -363,7 +363,7 @@ static void drawgrid(UnitSettings *unit, ARegion *ar, View3D *v3d, const char **
}
}
else { // start blending out (GRID_MIN_PX < dx < (GRID_MIN_PX*10))
- UI_ThemeColorBlend(TH_BACK, TH_GRID, dx / (GRID_MIN_PX * 6));
+ UI_ThemeColorBlend(TH_BACK, TH_GRID, dx / (GRID_MIN_PX * 6.0f));
drawgrid_draw(ar, wx, wy, x, y, dx);
UI_ThemeColor(TH_GRID);