Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-05-20 11:40:05 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-05-20 11:40:05 +0400
commit9f766c71b0a98801600c775dfc46faee84ddf49e (patch)
treee8d933e20df512eb836062e0f8cf9191f32c1141 /source/blender/editors/space_sequencer
parent2338765726a5aa6b8870d573d685218720864583 (diff)
use event->mval rather then subtracting ar->winrct.x / y from event->x / y
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r--source/blender/editors/space_sequencer/sequencer_add.c8
-rw-r--r--source/blender/editors/space_sequencer/sequencer_edit.c3
-rw-r--r--source/blender/editors/space_sequencer/sequencer_select.c15
3 files changed, 5 insertions, 21 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c
index ad0d0048388..6d50913dfd4 100644
--- a/source/blender/editors/space_sequencer/sequencer_add.c
+++ b/source/blender/editors/space_sequencer/sequencer_add.c
@@ -117,17 +117,11 @@ static void sequencer_generic_invoke_path__internal(bContext *C, wmOperator *op,
static void sequencer_generic_invoke_xy__internal(bContext *C, wmOperator *op, wmEvent *event, int flag)
{
- ARegion *ar= CTX_wm_region(C);
View2D *v2d= UI_view2d_fromcontext(C);
- int mval[2];
float mval_v2d[2];
-
- mval[0]= event->x - ar->winrct.xmin;
- mval[1]= event->y - ar->winrct.ymin;
-
- UI_view2d_region_to_view(v2d, mval[0], mval[1], &mval_v2d[0], &mval_v2d[1]);
+ UI_view2d_region_to_view(v2d, event->mval[0], event->mval[1], &mval_v2d[0], &mval_v2d[1]);
RNA_int_set(op->ptr, "channel", (int)mval_v2d[1]+0.5f);
RNA_int_set(op->ptr, "frame_start", (int)mval_v2d[0]);
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index 880f285c3e3..4b9f87f67d8 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -1573,14 +1573,13 @@ static int sequencer_cut_exec(bContext *C, wmOperator *op)
static int sequencer_cut_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
Scene *scene = CTX_data_scene(C);
- ARegion *ar= CTX_wm_region(C);
View2D *v2d= UI_view2d_fromcontext(C);
int cut_side= SEQ_SIDE_BOTH;
int cut_frame= CFRA;
if (ED_operator_sequencer_active(C) && v2d)
- cut_side= mouse_frame_side(v2d, event->x - ar->winrct.xmin, cut_frame);
+ cut_side= mouse_frame_side(v2d, event->mval[0], cut_frame);
RNA_int_set(op->ptr, "frame", cut_frame);
RNA_enum_set(op->ptr, "side", cut_side);
diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c
index 2cae2d17a33..8440a107f31 100644
--- a/source/blender/editors/space_sequencer/sequencer_select.c
+++ b/source/blender/editors/space_sequencer/sequencer_select.c
@@ -298,7 +298,6 @@ void SEQUENCER_OT_select_inverse(struct wmOperatorType *ot)
static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- ARegion *ar= CTX_wm_region(C);
View2D *v2d= UI_view2d_fromcontext(C);
Scene *scene= CTX_data_scene(C);
Editing *ed= seq_give_editing(scene, FALSE);
@@ -318,10 +317,7 @@ static int sequencer_select_invoke(bContext *C, wmOperator *op, wmEvent *event)
marker=find_nearest_marker(SCE_MARKERS, 1); //XXX - dummy function for now
- mval[0]= event->x - ar->winrct.xmin;
- mval[1]= event->y - ar->winrct.ymin;
-
- seq= find_nearest_seq(scene, v2d, &hand, mval);
+ seq= find_nearest_seq(scene, v2d, &hand, event->mval);
// XXX - not nice, Ctrl+RMB needs to do left_right only when not over a strip
if(seq && linked_time && left_right)
@@ -652,20 +648,15 @@ void SEQUENCER_OT_select_less(wmOperatorType *ot)
static int sequencer_select_linked_pick_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
Scene *scene= CTX_data_scene(C);
- ARegion *ar= CTX_wm_region(C);
View2D *v2d= UI_view2d_fromcontext(C);
short extend= RNA_boolean_get(op->ptr, "extend");
- int mval[2];
Sequence *mouse_seq;
int selected, hand;
-
- mval[0]= event->x - ar->winrct.xmin;
- mval[1]= event->y - ar->winrct.ymin;
-
+
/* this works like UV, not mesh */
- mouse_seq= find_nearest_seq(scene, v2d, &hand, mval);
+ mouse_seq= find_nearest_seq(scene, v2d, &hand, event->mval);
if (!mouse_seq)
return OPERATOR_FINISHED; /* user error as with mesh?? */