diff options
Diffstat (limited to 'source/blender/editors/gpencil/annotate_paint.c')
-rw-r--r-- | source/blender/editors/gpencil/annotate_paint.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c index 69b21731284..7b995c545ba 100644 --- a/source/blender/editors/gpencil/annotate_paint.c +++ b/source/blender/editors/gpencil/annotate_paint.c @@ -1079,17 +1079,6 @@ static void annotation_free_stroke(bGPDframe *gpf, bGPDstroke *gps) BLI_freelinkN(&gpf->strokes, gps); } -/** - * Which which point is in front (result should only be used for comparison). - */ -static float view3d_point_depth(const RegionView3D *rv3d, const float co[3]) -{ - if (rv3d->is_persp) { - return ED_view3d_calc_zfac(rv3d, co, NULL); - } - return -dot_v3v3(rv3d->viewinv[2], co); -} - /* only erase stroke points that are visible (3d view) */ static bool annotation_stroke_eraser_is_occluded(tGPsdata *p, const bGPDspoint *pt, @@ -1102,8 +1091,8 @@ static bool annotation_stroke_eraser_is_occluded(tGPsdata *p, float mval_3d[3]; if (ED_view3d_autodist_simple(p->region, mval_i, mval_3d, 0, NULL)) { - const float depth_mval = view3d_point_depth(rv3d, mval_3d); - const float depth_pt = view3d_point_depth(rv3d, &pt->x); + const float depth_mval = ED_view3d_calc_depth_for_comparison(rv3d, mval_3d); + const float depth_pt = ED_view3d_calc_depth_for_comparison(rv3d, &pt->x); if (depth_pt > depth_mval) { return true; |