[Bf-blender-cvs] [70d79397780] greasepencil-object: Cleanup: Make code more compact

Antonio Vazquez noreply at git.blender.org
Sun Apr 1 16:23:57 CEST 2018


Commit: 70d793977803cc34ef92f686b0f400e62d71f3ee
Author: Antonio Vazquez
Date:   Sun Apr 1 16:23:50 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB70d793977803cc34ef92f686b0f400e62d71f3ee

Cleanup: Make code more compact

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

M	source/blender/editors/space_view3d/view3d_select.c
M	source/blender/editors/util/undo.c

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

diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c
index 5e5999f888b..a71af5fc70e 100644
--- a/source/blender/editors/space_view3d/view3d_select.c
+++ b/source/blender/editors/space_view3d/view3d_select.c
@@ -1588,13 +1588,9 @@ static bool ed_object_select_pick(
 #if 0
 			if (((oldbasact) && oldbasact->object->type == OB_GPENCIL) || (basact->object->type == OB_GPENCIL)) {
 				/* set cursor */
-				if (basact->object->mode == OB_MODE_GPENCIL_PAINT) {
-					ED_gpencil_toggle_brush_cursor(C, true, NULL);
-				}
-				else if (basact->object->mode == OB_MODE_GPENCIL_SCULPT) {
-					ED_gpencil_toggle_brush_cursor(C, true, NULL);
-				}
-				else if (basact->object->mode == OB_MODE_GPENCIL_WEIGHT) {
+				if (ELEM(basact->object->mode == OB_MODE_GPENCIL_PAINT, 
+												OB_MODE_GPENCIL_SCULPT, 
+												OB_MODE_GPENCIL_WEIGHT)) {
 					ED_gpencil_toggle_brush_cursor(C, true, NULL);
 				}
 				else {
diff --git a/source/blender/editors/util/undo.c b/source/blender/editors/util/undo.c
index dfa0602cf98..1c8ebd8f4e4 100644
--- a/source/blender/editors/util/undo.c
+++ b/source/blender/editors/util/undo.c
@@ -153,13 +153,7 @@ static int ed_undo_step(bContext *C, int step, const char *undoname)
 			if (obact && (obact->type == OB_GPENCIL)) {
 				WorkSpace *workspace = CTX_wm_workspace(C);
 				/* set cursor */
-				if (workspace->object_mode == OB_MODE_GPENCIL_PAINT) {
-					ED_gpencil_toggle_brush_cursor(C, true, NULL);
-				}
-				else if (workspace->object_mode == OB_MODE_GPENCIL_SCULPT) {
-					ED_gpencil_toggle_brush_cursor(C, true, NULL);
-				}
-				else if (workspace->object_mode == OB_MODE_GPENCIL_WEIGHT) {
+				if (ELEM(workspace->object_mode, OB_MODE_GPENCIL_PAINT, OB_MODE_GPENCIL_SCULPT, OB_MODE_GPENCIL_WEIGHT)) {
 					ED_gpencil_toggle_brush_cursor(C, true, NULL);
 				}
 				else {



More information about the Bf-blender-cvs mailing list