diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-03-30 21:54:06 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2008-03-30 21:54:06 +0400 |
commit | e433465fc60b0f215410ac3fc7775b74a9562974 (patch) | |
tree | b055257529a202f016ad368e86c4442e7e849bb0 /source/blender/src/editsima.c | |
parent | 8c3c1c4a0be88480d6e5fb93f9a63c932d2057f6 (diff) |
Fix for crash with UV unwrap without an image window open. It really
shouldn't be using the image window but for now this fixes the crash.
Diffstat (limited to 'source/blender/src/editsima.c')
-rw-r--r-- | source/blender/src/editsima.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/source/blender/src/editsima.c b/source/blender/src/editsima.c index 75e79179d4a..d52ae4e7d9e 100644 --- a/source/blender/src/editsima.c +++ b/source/blender/src/editsima.c @@ -218,12 +218,18 @@ void transform_aspect_ratio_tface_uv(float *aspx, float *aspy) { int w, h; float xuser_asp, yuser_asp; - - aspect_sima(G.sima, &xuser_asp, &yuser_asp); - - transform_width_height_tface_uv(&w, &h); - *aspx= (float)w/256.0f * xuser_asp; - *aspy= (float)h/256.0f * yuser_asp; + + if(G.sima) { + aspect_sima(G.sima, &xuser_asp, &yuser_asp); + + transform_width_height_tface_uv(&w, &h); + *aspx= (float)w/256.0f * xuser_asp; + *aspy= (float)h/256.0f * yuser_asp; + } + else { + *aspx= 1.0f; + *aspy= 1.0f; + } } void transform_width_height_tface_uv(int *width, int *height) |