[Bf-blender-cvs] [a3b88c91729] master: Annotations: Make all 2D editors locked to View

Antonioya noreply at git.blender.org
Wed Apr 10 17:33:06 CEST 2019


Commit: a3b88c9172999deb120d98ab0da3206e31fe2527
Author: Antonioya
Date:   Wed Apr 10 17:32:44 2019 +0200
Branches: master
https://developer.blender.org/rBa3b88c9172999deb120d98ab0da3206e31fe2527

Annotations: Make all 2D editors locked to View

Before, there was a hacky code for Image editor when the image was empty.

Now, all 2D editors are locked to view and when you Move or Zoom, the stroke moves.

This is a fix of T63402.

Still pending if we add more options to 2D editors, but at least now,  we have something consistent.

===================================================================

M	source/blender/editors/gpencil/annotate_paint.c

===================================================================

diff --git a/source/blender/editors/gpencil/annotate_paint.c b/source/blender/editors/gpencil/annotate_paint.c
index b9b0c8fe788..5152bcb0a90 100644
--- a/source/blender/editors/gpencil/annotate_paint.c
+++ b/source/blender/editors/gpencil/annotate_paint.c
@@ -1423,34 +1423,8 @@ static void gp_paint_initstroke(tGPsdata *p, eGPencil_PaintModes paintmode, Deps
 				break;
 			}
 			case SPACE_NODE:
-			{
-				p->gpd->runtime.sbuffer_sflag |= GP_STROKE_2DSPACE;
-				break;
-			}
 			case SPACE_SEQ:
-			{
-				p->gpd->runtime.sbuffer_sflag |= GP_STROKE_2DSPACE;
-				break;
-			}
 			case SPACE_IMAGE:
-			{
-				SpaceImage *sima = (SpaceImage *)p->sa->spacedata.first;
-
-				/* only set these flags if the image editor doesn't have an image active,
-				 * otherwise user will be confused by strokes not appearing after they're drawn
-				 *
-				 * Admittedly, this is a bit hacky, but it works much nicer from an ergonomic standpoint!
-				 */
-				if (ELEM(NULL, sima, sima->image)) {
-					/* make strokes be drawn in screen space */
-					p->gpd->runtime.sbuffer_sflag &= ~GP_STROKE_2DSPACE;
-					*(p->align_flag) &= ~GP_PROJECT_VIEWSPACE;
-				}
-				else {
-					p->gpd->runtime.sbuffer_sflag |= GP_STROKE_2DSPACE;
-				}
-				break;
-			}
 			case SPACE_CLIP:
 			{
 				p->gpd->runtime.sbuffer_sflag |= GP_STROKE_2DSPACE;



More information about the Bf-blender-cvs mailing list