diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-12-14 20:51:02 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-12-14 20:51:02 +0400 |
commit | da7ce6a3ccdee61dacd64de3df0e041edef7a321 (patch) | |
tree | 097d24ecfe88108aaaeda9b3f2da6ff653caf400 /source/blender/editors/uvedit/uvedit_draw.c | |
parent | bb26d80ad88236800607bed0b0a72a5d14f67bb9 (diff) |
use UI_view2d_getscale() to get the scale for image cursor drawing and ED_mask_pixelspace_factor(). - was getting the image width/height when its not needed before.
Diffstat (limited to 'source/blender/editors/uvedit/uvedit_draw.c')
-rw-r--r-- | source/blender/editors/uvedit/uvedit_draw.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/editors/uvedit/uvedit_draw.c b/source/blender/editors/uvedit/uvedit_draw.c index c6b251b04ae..607640090aa 100644 --- a/source/blender/editors/uvedit/uvedit_draw.c +++ b/source/blender/editors/uvedit/uvedit_draw.c @@ -61,19 +61,19 @@ #include "UI_resources.h" #include "UI_interface.h" +#include "UI_view2d.h" #include "uvedit_intern.h" void draw_image_cursor(SpaceImage *sima, ARegion *ar) { - float zoomx, zoomy, x_fac, y_fac; - int width, height; + float zoom[2], x_fac, y_fac; - ED_space_image_get_size(sima, &width, &height); - ED_space_image_get_zoom(sima, ar, &zoomx, &zoomy); + UI_view2d_getscale_inverse(&ar->v2d, &zoom[0], &zoom[1]); - x_fac = (1.0f / (zoomx * width / 256.0f)) * UI_DPI_FAC; - y_fac = (1.0f / (zoomy * height / 256.0f)) * UI_DPI_FAC; + mul_v2_fl(zoom, 256.0f * UI_DPI_FAC); + x_fac = zoom[0]; + y_fac = zoom[1]; cpack(0xFFFFFF); glTranslatef(sima->cursor[0], sima->cursor[1], 0.0); |