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:
Diffstat (limited to 'source/blender/editors/space_clip/clip_draw.c')
-rw-r--r--source/blender/editors/space_clip/clip_draw.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/source/blender/editors/space_clip/clip_draw.c b/source/blender/editors/space_clip/clip_draw.c
index 983858ac568..aee6e2cda93 100644
--- a/source/blender/editors/space_clip/clip_draw.c
+++ b/source/blender/editors/space_clip/clip_draw.c
@@ -769,12 +769,12 @@ static float get_shortest_pattern_side(MovieTrackingMarker *marker)
next = (i + 1) % 4;
- cur_len = len_v2v2(marker->pattern_corners[i], marker->pattern_corners[next]);
+ cur_len = len_squared_v2v2(marker->pattern_corners[i], marker->pattern_corners[next]);
len = min_ff(cur_len, len);
}
- return len;
+ return sqrtf(len);
}
static void draw_marker_slide_square(float x, float y, float dx, float dy, int outline, float px[2])
@@ -1031,8 +1031,7 @@ static void getArrowEndPoint(const int width, const int height, const float zoom
direction[0] *= width;
direction[1] *= height;
- max_length = len_v2(direction);
- normalize_v2(direction);
+ max_length = normalize_v2(direction);
mul_v2_fl(direction, min_ff(32.0f / zoom, max_length));
direction[0] /= width;
direction[1] /= height;
@@ -1461,7 +1460,7 @@ static void draw_tracking_tracks(SpaceClip *sc, Scene *scene, ARegion *ar, Movie
sub_v2_v2(vec, npos);
- if (len_v2(vec) < 3.0f)
+ if (len_squared_v2(vec) < (3.0f * 3.0f))
glColor3f(0.0f, 1.0f, 0.0f);
else
glColor3f(1.0f, 0.0f, 0.0f);