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/mask/mask_edit.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/mask/mask_edit.c')
-rw-r--r-- | source/blender/editors/mask/mask_edit.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/source/blender/editors/mask/mask_edit.c b/source/blender/editors/mask/mask_edit.c index 18384ad9de4..cd2995be439 100644 --- a/source/blender/editors/mask/mask_edit.c +++ b/source/blender/editors/mask/mask_edit.c @@ -324,15 +324,13 @@ void ED_mask_pixelspace_factor(ScrArea *sa, ARegion *ar, float *scalex, float *s case SPACE_CLIP: { SpaceClip *sc = sa->spacedata.first; - int width, height; - float zoomx, zoomy, aspx, aspy; + float aspx, aspy; - ED_space_clip_get_size(sc, &width, &height); - ED_space_clip_get_zoom(sc, ar, &zoomx, &zoomy); + UI_view2d_getscale(&ar->v2d, scalex, scaley); ED_space_clip_get_aspect(sc, &aspx, &aspy); - *scalex = ((float)width * aspx) * zoomx; - *scaley = ((float)height * aspy) * zoomy; + *scalex *= aspx; + *scaley *= aspy; break; } case SPACE_SEQ: @@ -343,15 +341,13 @@ void ED_mask_pixelspace_factor(ScrArea *sa, ARegion *ar, float *scalex, float *s case SPACE_IMAGE: { SpaceImage *sima = sa->spacedata.first; - int width, height; - float zoomx, zoomy, aspx, aspy; + float aspx, aspy; - ED_space_image_get_size(sima, &width, &height); - ED_space_image_get_zoom(sima, ar, &zoomx, &zoomy); + UI_view2d_getscale(&ar->v2d, scalex, scaley); ED_space_image_get_aspect(sima, &aspx, &aspy); - *scalex = ((float)width * aspx) * zoomx; - *scaley = ((float)height * aspy) * zoomy; + *scalex *= aspx; + *scaley *= aspy; break; } default: |