diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-10-21 17:33:51 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-10-21 17:33:51 +0400 |
commit | 59d174067161ea9835068f5b12e426efe6497fe1 (patch) | |
tree | 17f3ddd76b4259a7bac7a7b437c7c754c0987c8c | |
parent | bef30b270b3113fc31cb6c9bcea7d463c7bcebb5 (diff) |
bugfix [#24331] EdgeSlide not as flawless as 2.49's
ensure minimum mouse distance for sliding edge verts else it becomes unusable.
-rw-r--r-- | source/blender/editors/transform/transform.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index e6a42b9a921..a43078e5d6a 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -4563,7 +4563,26 @@ static int createSlideVerts(TransInfo *t) start[0] = t->mval[0]; start[1] = t->mval[1]; add_v3_v3v3(end, start, vec); - + + + /* Ensure minimum screen distance, when looking top down on edge loops */ +#define EDGE_SLIDE_MIN 30 + if (len_squared_v2v2(start, end) < (EDGE_SLIDE_MIN * EDGE_SLIDE_MIN)) { + if(ABS(start[0]-end[0]) + ABS(start[1]-end[1]) < 4.0f) { + /* even more exceptional case, points are ontop of eachother */ + end[0]= start[0]; + end[1]= start[1] + EDGE_SLIDE_MIN; + } + else { + sub_v2_v2(end, start); + normalize_v2(end); + mul_v2_fl(end, EDGE_SLIDE_MIN); + add_v2_v2(end, start); + } + } +#undef EDGE_SLIDE_MIN + + sld->start[0] = (short) start[0]; sld->start[1] = (short) start[1]; sld->end[0] = (short) end[0]; |