diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2021-05-18 23:31:10 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2021-05-20 17:03:24 +0300 |
commit | 729c579030aef61602e1bac043322da6ccb2279b (patch) | |
tree | 9b62271c2a46b5e9922cd4b25baa3b8ea5e5a687 /source/blender/editors/gpencil | |
parent | a1954e380730ae9d116245343d9296d587907673 (diff) |
Fix T88313: GPencil reproject operator projecting on the wrong surface
`ray_start` must start at the position of the gpencil point.
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_utils.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 9fba2ce5902..04764587ebe 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -1276,7 +1276,6 @@ void ED_gpencil_stroke_reproject(Depsgraph *depsgraph, } else { /* Geometry - Snap to surfaces of visible geometry */ - float ray_start[3]; float ray_normal[3]; /* magic value for initial depth copied from the default * value of Python's Scene.ray_cast function @@ -1285,13 +1284,14 @@ void ED_gpencil_stroke_reproject(Depsgraph *depsgraph, float location[3] = {0.0f, 0.0f, 0.0f}; float normal[3] = {0.0f, 0.0f, 0.0f}; - ED_view3d_win_to_ray(region, xy, &ray_start[0], &ray_normal[0]); + ED_view3d_win_to_vector(region, xy, &ray_normal[0]); + BLI_assert(gps->flag & GP_STROKE_3DSPACE); if (ED_transform_snap_object_project_ray(sctx, depsgraph, &(const struct SnapObjectParams){ .snap_select = SNAP_ALL, }, - &ray_start[0], + &pt2.x, &ray_normal[0], &depth, &location[0], |