diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-10-05 07:20:14 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-10-05 07:20:14 +0400 |
commit | b9113f205ceb7bc1f8620024a0adf4b4eb681792 (patch) | |
tree | 078cff7c93e213f1349f207d9de9f563ccfc6f20 /source/blender/editors/sculpt_paint | |
parent | 080f4441d2e7538c99c22621991bdd6c11a8476f (diff) |
replace ED_view3d_project_float with ED_view3d_project_float_global
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_cursor.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_cursor.c b/source/blender/editors/sculpt_paint/paint_cursor.c index e14266c83a7..6120229190d 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.c +++ b/source/blender/editors/sculpt_paint/paint_cursor.c @@ -322,11 +322,16 @@ static int project_brush_radius(ViewContext *vc, add_v3_v3v3(offset, location, ortho); /* project the center of the brush, and the tangent point to the view onto the screen */ - ED_view3d_project_float(vc->ar, location, p1); - ED_view3d_project_float(vc->ar, offset, p2); - - /* the distance between these points is the size of the projected brush in pixels */ - return len_v2v2(p1, p2); + if ((ED_view3d_project_float_global(vc->ar, location, p1, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_SUCCESS) && + (ED_view3d_project_float_global(vc->ar, offset, p2, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_SUCCESS)) + { + /* the distance between these points is the size of the projected brush in pixels */ + return len_v2v2(p1, p2); + } + else { + BLI_assert(0); /* assert because the code that sets up the vectors should disallow this */ + return 0; + } } static int sculpt_get_brush_geometry(bContext *C, ViewContext *vc, |