[Bf-blender-cvs] [4cd2f80f9da] greasepencil-object: Cleanup: Streamline logic here - just check once, not twice

Joshua Leung noreply at git.blender.org
Tue Jan 30 07:05:37 CET 2018


Commit: 4cd2f80f9daa8f1e74fb71025e1407970398ddf7
Author: Joshua Leung
Date:   Tue Jan 30 16:13:53 2018 +1300
Branches: greasepencil-object
https://developer.blender.org/rB4cd2f80f9daa8f1e74fb71025e1407970398ddf7

Cleanup: Streamline logic here - just check once, not twice

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

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

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

diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c
index 6fa75e462a2..719f4203aea 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -506,17 +506,14 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e
 	
 	switch (event->type) {
 		case LEFTMOUSE:
-			if (tgpi->flag == IDLE) {
-				tgpi->top[0] = event->mval[0];
-				tgpi->top[1] = event->mval[1];
-			}
-
 			tgpi->bottom[0] = event->mval[0];
 			tgpi->bottom[1] = event->mval[1];
-
+			
 			if (tgpi->flag == IDLE) {
 				tgpi->flag = IN_PROGRESS;
-				break;
+				
+				tgpi->top[0] = event->mval[0];
+				tgpi->top[1] = event->mval[1];
 			}
 			else {
 				tgpi->flag = IDLE;



More information about the Bf-blender-cvs mailing list