diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-05-21 18:44:50 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2013-05-21 18:44:50 +0400 |
commit | 68b9794a40d39489d811c2bef8fdee49aee3ce0a (patch) | |
tree | e7fd9fc5c10a846be5234bd7afc3d081b870fe6d /source | |
parent | 6b7d2ed8b67b9d4e44cb89802891799879212897 (diff) |
Fix #35232: Marker right-click misbehavior on adding
Made it so Add Marker button from toolbox will place
marker in the middle of the frame.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_clip/tracking_ops.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index 366d0d6e822..46bdc7ca173 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -129,11 +129,12 @@ static int add_marker_invoke(bContext *C, wmOperator *op, const wmEvent *event) SpaceClip *sc = CTX_wm_space_clip(C); ARegion *ar = CTX_wm_region(C); - float co[2]; - - ED_clip_mouse_pos(sc, ar, event->mval, co); - - RNA_float_set_array(op->ptr, "location", co); + if (!RNA_struct_property_is_set(op->ptr, "location")) { + /* If location is not set, use mouse positio nas default. */ + float co[2]; + ED_clip_mouse_pos(sc, ar, event->mval, co); + RNA_float_set_array(op->ptr, "location", co); + } return add_marker_exec(C, op); } |