diff options
author | Falk David <falkdavid@gmx.de> | 2021-01-26 20:04:52 +0300 |
---|---|---|
committer | Falk David <falkdavid@gmx.de> | 2021-01-26 20:37:08 +0300 |
commit | 23e108c5b608e58ae46f11a0f2badde6710b7495 (patch) | |
tree | dbdba03987e925b8f5b36aefb5e4ce3f0e967411 /source/blender/editors/gpencil/gpencil_paint.c | |
parent | abd6b1d7b281c85fce748e0535f1f769916cd9b3 (diff) |
Fix T85082: Perspective distortion while drawing
When the drawing plane was set to view and the user would pan their
camera sideways, the drawing would be more and more distorted and
projected further back.
The fix projects the strokes to view when the user is looking through
the camera or has the drawing plane set to view.
Reviewed By: antoniov
Maniphest Tasks: T85082
Differential Revision: https://developer.blender.org/D10213
Diffstat (limited to 'source/blender/editors/gpencil/gpencil_paint.c')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 14313a50118..fcdada1e673 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -1084,8 +1084,8 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p) gpencil_apply_parent_point(depsgraph, obact, gpl, pt); } - /* if camera view, reproject flat to view to avoid perspective effect */ - if (is_camera) { + /* If camera view or view projection, reproject flat to view to avoid perspective effect. */ + if ((*p->align_flag & GP_PROJECT_VIEWSPACE) || is_camera) { ED_gpencil_project_stroke_to_view(p->C, p->gpl, gps); } } @@ -1233,8 +1233,8 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p) gpencil_reproject_toplane(p, gps); /* change position relative to parent object */ gpencil_apply_parent(depsgraph, obact, gpl, gps); - /* if camera view, reproject flat to view to avoid perspective effect */ - if (is_camera) { + /* If camera view or view projection, reproject flat to view to avoid perspective effect. */ + if ((*p->align_flag & GP_PROJECT_VIEWSPACE) || is_camera) { ED_gpencil_project_stroke_to_view(p->C, p->gpl, gps); } |