diff options
author | Sergey Sharybin <sergey@blender.org> | 2022-05-23 16:20:44 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey@blender.org> | 2022-05-23 16:22:08 +0300 |
commit | 09292b89c3354dc099f3f1f1c37ad3bfbdb53dff (patch) | |
tree | 21df473e0ad3621288a878fed4caf4786e87e6ff /source/blender/editors/mask/mask_query.c | |
parent | 00506d7a86a8e66aebbc89c0934ef23917acab91 (diff) |
Fix wrong mouse tolerance in mask editor
There are two issues. The biggest one was that a pixel value was used
to compare a squared distance meaning the tolerance was too strict.
The other issue was that the tolerance in pixels was different to what
the tracking mode is using.
The user-level change is that now it should be easier to tweak the
mask shape.
Diffstat (limited to 'source/blender/editors/mask/mask_query.c')
-rw-r--r-- | source/blender/editors/mask/mask_query.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/editors/mask/mask_query.c b/source/blender/editors/mask/mask_query.c index afe457a8502..89524a7b9e2 100644 --- a/source/blender/editors/mask/mask_query.c +++ b/source/blender/editors/mask/mask_query.c @@ -45,6 +45,8 @@ bool ED_mask_find_nearest_diff_point(const bContext *C, float *r_u, float *r_score) { + const float threshold_sq = threshold * threshold; + ScrArea *area = CTX_wm_area(C); ARegion *region = CTX_wm_region(C); @@ -139,7 +141,7 @@ bool ED_mask_find_nearest_diff_point(const bContext *C, } } - if (point && dist_best_sq < threshold) { + if (point && dist_best_sq < threshold_sq) { if (r_mask_layer) { *r_mask_layer = point_mask_layer; } |