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
path: root/source
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-09-13 17:29:10 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-09-13 17:29:10 +0400
commit888c4fd2534ec33ec05c5f2cd96d936a9a1b6e35 (patch)
tree97bc7971d55655204d5c239a7e3d4a7dcd8d3ec0 /source
parentc3b808721bb110caac3a60cff80bddc4414d65a5 (diff)
Fix #32547: unwrap on default cube got broken in recent commit.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/space_image/image_edit.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/editors/space_image/image_edit.c b/source/blender/editors/space_image/image_edit.c
index 360cbc3f026..79d01491df7 100644
--- a/source/blender/editors/space_image/image_edit.c
+++ b/source/blender/editors/space_image/image_edit.c
@@ -230,13 +230,19 @@ void ED_space_image_get_uv_aspect(SpaceImage *sima, float *aspx, float *aspy)
void ED_image_get_uv_aspect(Image *ima, ImageUser *iuser, float *aspx, float *aspy)
{
- int w, h;
+ if (ima) {
+ int w, h;
- BKE_image_get_aspect(ima, aspx, aspy);
- BKE_image_get_size(ima, iuser, &w, &h);
+ BKE_image_get_aspect(ima, aspx, aspy);
+ BKE_image_get_size(ima, iuser, &w, &h);
- *aspx *= (float)w;
- *aspy *= (float)h;
+ *aspx *= (float)w;
+ *aspy *= (float)h;
+ }
+ else {
+ *aspx = 1.0f;
+ *aspy = 1.0f;
+ }
}
/* takes event->mval */