diff options
author | Sergey Sharybin <sergey@blender.org> | 2022-03-24 18:21:59 +0300 |
---|---|---|
committer | Fabian Schempp <fabianschempp@googlemail.com> | 2022-04-11 01:31:45 +0300 |
commit | e8ad7cac5bcdfe668c5fdd4fb90ab55d8a7114e7 (patch) | |
tree | 1b78d1c6b014101113bbb1180186f95078f9ce93 /source/blender/editors/space_clip/tracking_ops.c | |
parent | 4cc83ba0370b2c1bd3c8f2889868c0e8e54e6116 (diff) |
Tracking: Fix jump when sliding tild/scale of marker
Was a mistake in coordinate handling: need to take possible offset
from the sliding area.
Mouse us still not fully perfectly follows changes of the tilt slide
area, but that is a separate issue.
Diffstat (limited to 'source/blender/editors/space_clip/tracking_ops.c')
-rw-r--r-- | source/blender/editors/space_clip/tracking_ops.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/source/blender/editors/space_clip/tracking_ops.c b/source/blender/editors/space_clip/tracking_ops.c index 6660ff3b78b..1a497a35b6f 100644 --- a/source/blender/editors/space_clip/tracking_ops.c +++ b/source/blender/editors/space_clip/tracking_ops.c @@ -876,22 +876,13 @@ static int slide_marker_modal(bContext *C, wmOperator *op, const wmEvent *event) BKE_tracking_marker_clamp(data->marker, CLAMP_PAT_DIM); } else if (data->action == SLIDE_ACTION_TILT_SIZE) { + const float mouse_delta[2] = {dx, dy}; float start[2], end[2]; float scale = 1.0f, angle = 0.0f; - float mval[2]; - - if (data->accurate) { - mval[0] = data->mval[0] + (event->mval[0] - data->mval[0]) / 5.0f; - mval[1] = data->mval[1] + (event->mval[1] - data->mval[1]) / 5.0f; - } - else { - mval[0] = event->mval[0]; - mval[1] = event->mval[1]; - } sub_v2_v2v2(start, data->spos, data->old_pos); - ED_clip_point_stable_pos(sc, region, mval[0], mval[1], &end[0], &end[1]); + add_v2_v2v2(end, data->spos, mouse_delta); sub_v2_v2(end, data->old_pos); if (len_squared_v2(start) != 0.0f) { |