GP: Don't use offset for Stroke projection
authorAntonioya <blendergit@gmail.com>
Tue, 1 Jan 2019 15:44:10 +0000 (16:44 +0100)
committerAntonioya <blendergit@gmail.com>
Tue, 1 Jan 2019 15:44:10 +0000 (16:44 +0100)
The offset is only used in Surface mode.

source/blender/editors/gpencil/gpencil_paint.c

index 9ec3510..ff96785 100644 (file)
@@ -370,7 +370,10 @@ static void gp_stroke_convertcoords(tGPsdata *p, const float mval[2], float out[
        if (gpd->runtime.sbuffer_sflag & GP_STROKE_3DSPACE) {
 
                /* add small offset to keep stroke over the surface */
-               if ((depth) && (gpd->zdepth_offset > 0.0f)) {
+               if ((depth) &&
+                       (gpd->zdepth_offset > 0.0f) &&
+                       (*p->align_flag & GP_PROJECT_DEPTH_VIEW))
+               {
                        *depth *= (1.0f - gpd->zdepth_offset);
                }