diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-07-27 19:15:55 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-07-27 19:15:55 +0400 |
commit | f1acd6ac3e78aa4b898ee310dae2814015616e5f (patch) | |
tree | f9e12a8ac3f65b75465920ec188803751fe06c8b /source/blender/editors/space_image | |
parent | 49e0c832e16195d8a656798830a63074eb6cd6c7 (diff) |
code cleanup: pass mouse position as int[2] rather then wmEvent
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r-- | source/blender/editors/space_image/image_edit.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/space_image/image_edit.c b/source/blender/editors/space_image/image_edit.c index 65df6f98efb..81423560fb5 100644 --- a/source/blender/editors/space_image/image_edit.c +++ b/source/blender/editors/space_image/image_edit.c @@ -260,7 +260,8 @@ void ED_image_get_uv_aspect(Image *ima, float *aspx, float *aspy) *aspy *= (float)h; } -void ED_image_mouse_pos(SpaceImage *sima, ARegion *ar, wmEvent *event, float co[2]) +/* takes event->mval */ +void ED_image_mouse_pos(SpaceImage *sima, ARegion *ar, const int mval[2], float co[2]) { int sx, sy, width, height; float zoomx, zoomy; @@ -270,8 +271,8 @@ void ED_image_mouse_pos(SpaceImage *sima, ARegion *ar, wmEvent *event, float co[ UI_view2d_to_region_no_clip(&ar->v2d, 0.0f, 0.0f, &sx, &sy); - co[0] = ((event->mval[0] - sx) / zoomx) / width; - co[1] = ((event->mval[1] - sy) / zoomy) / height; + co[0] = ((mval[0] - sx) / zoomx) / width; + co[1] = ((mval[1] - sy) / zoomy) / height; } void ED_image_point_pos(SpaceImage *sima, ARegion *ar, float x, float y, float *xr, float *yr) |