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:
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r--source/blender/editors/space_image/space_image.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/editors/space_image/space_image.c b/source/blender/editors/space_image/space_image.c
index d9772c79914..9d5b5048d75 100644
--- a/source/blender/editors/space_image/space_image.c
+++ b/source/blender/editors/space_image/space_image.c
@@ -225,9 +225,18 @@ void ED_space_image_uv_aspect(SpaceImage *sima, float *aspx, float *aspy)
ED_space_image_aspect(sima, aspx, aspy);
ED_space_image_size(sima, &w, &h);
+
+ *aspx *= (float)w;
+ *aspy *= (float)h;
- *aspx *= (float)w/256.0f;
- *aspy *= (float)h/256.0f;
+ if(*aspx < *aspy) {
+ *aspy= *aspy / *aspx;
+ *aspx= 1.0f;
+ }
+ else {
+ *aspx= *aspx / *aspy;
+ *aspy= 1.0f;
+ }
}
void ED_image_uv_aspect(Image *ima, float *aspx, float *aspy)