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>2011-03-27 18:59:55 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-03-27 18:59:55 +0400
commit617e6a83bc89ca36e18bd06d851a31c010e11db2 (patch)
treed1347daa3d9a7bf51a0168048247cfe1ce13a4ee /source/blender/editors/space_image
parent8d7c3f8a7e6de7625b3631cd91242fbefa98cf3a (diff)
object/paint/misc-files: floats were being implicitly promoted to doubles, adjust to use floats.
- also UV angle stretching was using radians->deg which wasn't needed.
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r--source/blender/editors/space_image/image_draw.c14
-rw-r--r--source/blender/editors/space_image/image_ops.c10
2 files changed, 12 insertions, 12 deletions
diff --git a/source/blender/editors/space_image/image_draw.c b/source/blender/editors/space_image/image_draw.c
index aa748745cd2..3e028607172 100644
--- a/source/blender/editors/space_image/image_draw.c
+++ b/source/blender/editors/space_image/image_draw.c
@@ -151,7 +151,7 @@ void draw_image_info(ARegion *ar, int channels, int x, int y, char *cp, float *f
}
if(zp)
- ofs+= BLI_snprintf(str + ofs, sizeof(str)-ofs, "| Z: %.4f ", 0.5+0.5*(((float)*zp)/(float)0x7fffffff));
+ ofs+= BLI_snprintf(str + ofs, sizeof(str)-ofs, "| Z: %.4f ", 0.5f+0.5f*(((float)*zp)/(float)0x7fffffff));
if(zpf)
ofs+= BLI_snprintf(str + ofs, sizeof(str)-ofs, "| Z: %.3f ", *zpf);
(void)ofs;
@@ -193,21 +193,21 @@ static void draw_image_grid(ARegion *ar, float zoomx, float zoomy)
if(gridsize<1.0f) {
while(gridsize<1.0f) {
- gridsize*= 4.0;
- gridstep*= 4.0;
+ gridsize*= 4.0f;
+ gridstep*= 4.0f;
}
}
else {
while(gridsize>=4.0f) {
- gridsize/= 4.0;
- gridstep/= 4.0;
+ gridsize/= 4.0f;
+ gridstep/= 4.0f;
}
}
/* the fine resolution level */
- blendfac= 0.25*gridsize - floor(0.25*gridsize);
+ blendfac= 0.25*gridsize - floor(0.25f*gridsize);
CLAMP(blendfac, 0.0, 1.0);
- UI_ThemeColorShade(TH_BACK, (int)(20.0*(1.0-blendfac)));
+ UI_ThemeColorShade(TH_BACK, (int)(20.0f*(1.0f-blendfac)));
fac= 0.0f;
glBegin(GL_LINES);
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 3aa509ab998..56b5ed10c56 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -394,7 +394,7 @@ static int view_zoom_modal(bContext *C, wmOperator *op, wmEvent *event)
switch(event->type) {
case MOUSEMOVE:
- factor= 1.0 + (vpd->x-event->x+vpd->y-event->y)/300.0f;
+ factor= 1.0f + (vpd->x-event->x+vpd->y-event->y)/300.0f;
RNA_float_set(op->ptr, "factor", factor);
sima_zoom_set(sima, ar, vpd->zoom*factor);
ED_region_tag_redraw(CTX_wm_region(C));
@@ -522,10 +522,10 @@ static int view_selected_exec(bContext *C, wmOperator *UNUSED(op))
d[0]= max[0] - min[0];
d[1]= max[1] - min[1];
- size= 0.5*MAX2(d[0], d[1])*MAX2(width, height)/256.0f;
+ size= 0.5f*MAX2(d[0], d[1])*MAX2(width, height)/256.0f;
- if(size<=0.01) size= 0.01;
- sima_zoom_set(sima, ar, 0.7/size);
+ if(size<=0.01f) size= 0.01f;
+ sima_zoom_set(sima, ar, 0.7f/size);
ED_region_tag_redraw(CTX_wm_region(C));
@@ -1655,7 +1655,7 @@ static void sample_apply(bContext *C, wmOperator *op, wmEvent *event)
my= event->y - ar->winrct.ymin;
UI_view2d_region_to_view(&ar->v2d, mx, my, &fx, &fy);
- if(fx>=0.0 && fy>=0.0 && fx<1.0 && fy<1.0) {
+ if(fx>=0.0f && fy>=0.0f && fx<1.0f && fy<1.0f) {
float *fp;
char *cp;
int x= (int)(fx*ibuf->x), y= (int)(fy*ibuf->y);