[Bf-blender-cvs] [9afd9dc] GPencil_Editing_Stage3: Fix: Save off GPencil eraser size earlier, to prevent it from being zeroed if something goes wrong (e.g. locked layers) in the meantime

Joshua Leung noreply at git.blender.org
Fri Dec 11 05:30:23 CET 2015


Commit: 9afd9dc78e06926206a9f451974e24c4d73e521e
Author: Joshua Leung
Date:   Fri Dec 11 17:27:32 2015 +1300
Branches: GPencil_Editing_Stage3
https://developer.blender.org/rB9afd9dc78e06926206a9f451974e24c4d73e521e

Fix: Save off GPencil eraser size earlier, to prevent it from being zeroed if something goes wrong (e.g. locked layers) in the meantime

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

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

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

diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 04e9a77..753aa3b 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -1181,6 +1181,12 @@ static tGPsdata *gp_session_initpaint(bContext *C)
 	
 	gp_session_initdata(C, p);
 	
+	/* radius for eraser circle is defined in userprefs now */
+	/* NOTE: we do this here, so that if we exit immediately,
+	 *       erase size won't get lost
+	 */
+	p->radius = U.gp_eraser;
+	
 	/* return context data for running paint operator */
 	return p;
 }
@@ -1519,9 +1525,6 @@ static int gpencil_draw_init(bContext *C, wmOperator *op)
 		return 0;
 	}
 	
-	/* radius for eraser circle is defined in userprefs now */
-	p->radius = U.gp_eraser;
-	
 	/* everything is now setup ok */
 	return 1;
 }




More information about the Bf-blender-cvs mailing list