diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-09-06 18:02:28 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2011-09-06 18:02:28 +0400 |
commit | 0c15f834e49b2e1c43c0e06f1fd8a7e7f5faa83f (patch) | |
tree | f7257e759f7245be35022de476ba7d9b1bd4413d /source/blender/editors/gpencil | |
parent | 47ffe63c86eb495aa5556939467692484aea8322 (diff) |
Fix for poly line grease pencil and surface drawing.
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r-- | source/blender/editors/gpencil/gpencil_paint.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c index 460408c6269..a23f2064a9e 100644 --- a/source/blender/editors/gpencil/gpencil_paint.c +++ b/source/blender/editors/gpencil/gpencil_paint.c @@ -400,6 +400,15 @@ static short gp_stroke_addpoint (tGPsdata *p, const int mval[2], float pressure) pts = &gps->points[gps->totpoints-1]; + /* special case for poly lines: normally, depth is needed only when creating new stroke from buffer, + but poly lines are converting to stroke instantly, so initialize depth buffer before converting coordinates */ + if (gpencil_project_check(p)) { + View3D *v3d= p->sa->spacedata.first; + + view3d_region_operator_needs_opengl(p->win, p->ar); + ED_view3d_autodist_init(p->scene, p->ar, v3d, (p->gpd->flag & GP_DATA_DEPTH_STROKE) ? 1:0); + } + /* convert screen-coordinates to appropriate coordinates (and store them) */ gp_stroke_convertcoords(p, &pt->x, &pts->x, NULL); |