diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-05-20 11:40:05 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-05-20 11:40:05 +0400 |
commit | 9f766c71b0a98801600c775dfc46faee84ddf49e (patch) | |
tree | e8d933e20df512eb836062e0f8cf9191f32c1141 /source/blender/editors/animation/anim_ops.c | |
parent | 2338765726a5aa6b8870d573d685218720864583 (diff) |
use event->mval rather then subtracting ar->winrct.x / y from event->x / y
Diffstat (limited to 'source/blender/editors/animation/anim_ops.c')
-rw-r--r-- | source/blender/editors/animation/anim_ops.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index ff9521f1ebd..93d99c59a0e 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -107,14 +107,9 @@ static int frame_from_event(bContext *C, wmEvent *event) { ARegion *region= CTX_wm_region(C); float viewx; - int x, y; - - /* convert screen coordinates to region coordinates */ - x= event->x - region->winrct.xmin; - y= event->y - region->winrct.ymin; - + /* convert from region coordinates to View2D 'tot' space */ - UI_view2d_region_to_view(®ion->v2d, x, y, &viewx, NULL); + UI_view2d_region_to_view(®ion->v2d, event->mval[0], event->mval[1], &viewx, NULL); /* round result to nearest int (frames are ints!) */ return (int)floor(viewx+0.5f); |