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.
This commit is contained in:
Sergey Sharybin
2013-05-21 14:44:50 +00:00
parent 6b7d2ed8b6
commit 68b9794a40
2 changed files with 8 additions and 6 deletions

View File

@@ -211,7 +211,8 @@ class CLIP_PT_tools_marker(CLIP_PT_tracking_panel, Panel):
settings = clip.tracking.settings
col = layout.column(align=True)
col.operator("clip.add_marker_move")
props = col.operator("clip.add_marker")
props.location = (0.5, 0.5)
col.operator("clip.detect_features")
col.operator("clip.delete_track")

View File

@@ -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);
}