[Bf-blender-cvs] [eea081cd5f1] greasepencil-object: GP: Primitive: Revert adding new cursor and use nsew instead

Charlie Jolly noreply at git.blender.org
Fri Dec 14 16:33:42 CET 2018


Commit: eea081cd5f1af392bb5d788d77c13a767908d861
Author: Charlie Jolly
Date:   Fri Dec 14 15:28:21 2018 +0000
Branches: greasepencil-object
https://developer.blender.org/rBeea081cd5f1af392bb5d788d77c13a767908d861

GP: Primitive: Revert adding new cursor and use nsew instead

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

M	source/blender/editors/gpencil/gpencil_primitive.c
M	source/blender/windowmanager/intern/wm_cursors.c
M	source/blender/windowmanager/wm_cursors.h

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

diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c
index a799ac41dd5..dcb4dfa038b 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -1170,7 +1170,7 @@ static void gpencil_primitive_edit_event_handling(bContext *C, wmOperator *op, w
 	if (tgpi->flag == IN_CURVE_EDIT) {
 		if ((a < BIG_SIZE_CTL && tgpi->tot_stored_edges == 0) || b < BIG_SIZE_CTL) {
 			move = MOVE_ENDS;
-			WM_cursor_modal_set(win, BC_RING_CURSOR);
+			WM_cursor_modal_set(win, BC_NSEW_SCROLLCURSOR);
 		}
 		else if(tgpi->curve) {
 			move = MOVE_CP;
@@ -1180,6 +1180,9 @@ static void gpencil_primitive_edit_event_handling(bContext *C, wmOperator *op, w
 			WM_cursor_modal_set(win, BC_CROSSCURSOR);
 		}
 	}
+	else if (tgpi->flag == IN_PROGRESS) {
+		WM_cursor_modal_set(win, BC_NSEW_SCROLLCURSOR);
+	}
 
 	switch (event->type) {
 		case MOUSEMOVE:
@@ -1248,6 +1251,7 @@ static void gpencil_primitive_edit_event_handling(bContext *C, wmOperator *op, w
 		{
 			if (tgpi->flag == IN_CURVE_EDIT && !ELEM(tgpi->type, GP_STROKE_BOX, GP_STROKE_CIRCLE)) {
 				tgpi->flag = IN_PROGRESS;
+				WM_cursor_modal_set(win, BC_NSEW_SCROLLCURSOR);
 				gpencil_primitive_add_segment(tgpi);
 				copy_v2_v2(tgpi->start, tgpi->end);
 				copy_v2_v2(tgpi->origin, tgpi->start);
@@ -1399,6 +1403,7 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e
 		{
 			if ((event->val == KM_PRESS)) {
 				tgpi->flag = IN_MOVE;
+				WM_cursor_modal_set(win, BC_NSEW_SCROLLCURSOR);
 			}
 			break;
 		}
@@ -1435,6 +1440,7 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e
 		{
 			if (tgpi->flag == IN_CURVE_EDIT) {
 				tgpi->flag = IN_PROGRESS;
+				WM_cursor_modal_set(win, BC_NSEW_SCROLLCURSOR);
 				gp_primitive_update_cps(tgpi);
 				gpencil_primitive_update(C, op, tgpi);
 			}
diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c
index ec98159e673..b411d9a4957 100644
--- a/source/blender/windowmanager/intern/wm_cursors.c
+++ b/source/blender/windowmanager/intern/wm_cursors.c
@@ -1110,77 +1110,6 @@ BEGIN_CURSOR_BLOCK
 	BlenderCursor[BC_SWAPAREA_CURSOR] = &SwapCursor;
 
 END_CURSOR_BLOCK
-
-/********************** Ring Cursor ***********************/
-BEGIN_CURSOR_BLOCK
-static char ring_sbm[] = {
-	 0x00,  0x00,  0x00,  0x00,  0x00,  0x00,  0x00,  0x00,
-	 0xc0,  0x03,  0x20,  0x04,  0x10,  0x08,  0x10,  0x08,
-	 0x10,  0x08,  0x10,  0x08,  0x20,  0x04,  0xc0,  0x03,
-	 0x00,  0x00,  0x00,  0x00,  0x00,  0x00,  0x00,  0x00,
-};
-
-static char ring_smsk[] = {
-	 0x00,  0x00,  0x00,  0x00,  0x00,  0x00,  0xc0,  0x03,
-	 0xe0,  0x07,  0x30,  0x0c,  0x18,  0x18,  0x18,  0x18,
-	 0x18,  0x18,  0x18,  0x18,  0x30,  0x0c,  0xe0,  0x07,
-	 0xc0,  0x03,  0x00,  0x00,  0x00,  0x00,  0x00,  0x00,
-};
-
-static char ring_lbm[] = {
-	0x00,  0x00,  0x00,  0x00,  0x00,  0x00,  0x00,  0x00,
-	0x00,  0x80,  0x01,  0x00,  0x00,  0x80,  0x01,  0x00,
-	0x00,  0x80,  0x01,  0x00,  0x00,  0x80,  0x01,  0x00,
-	0x00,  0x80,  0x01,  0x00,  0x00,  0x80,  0x01,  0x00,
-	0x00,  0x80,  0x01,  0x00,  0x00,  0x80,  0x01,  0x00,
-	0x00,  0x80,  0x01,  0x00,  0x00,  0xc0,  0x03,  0x00,
-	0x00,  0xc0,  0x03,  0x00,  0x00,  0x40,  0x02,  0x00,
-	0x00,  0x78,  0x1e,  0x00,  0xfc,  0x1f,  0xf8,  0x3f,
-	0xfc,  0x1f,  0xf8,  0x3f,  0x00,  0x78,  0x1e,  0x00,
-	0x00,  0x40,  0x02,  0x00,  0x00,  0xc0,  0x03,  0x00,
-	0x00,  0xc0,  0x03,  0x00,  0x00,  0x80,  0x01,  0x00,
-	0x00,  0x80,  0x01,  0x00,  0x00,  0x80,  0x01,  0x00,
-	0x00,  0x80,  0x01,  0x00,  0x00,  0x80,  0x01,  0x00,
-	0x00,  0x80,  0x01,  0x00,  0x00,  0x80,  0x01,  0x00,
-	0x00,  0x80,  0x01,  0x00,  0x00,  0x80,  0x01,  0x00,
-	0x00,  0x00,  0x00,  0x00,  0x00,  0x00,  0x00,  0x00,
-};
-
-static char ring_lmsk[] = {
-	0x00,  0x80,  0x01,  0x00,  0x00,  0x80,  0x01,  0x00,
-	0x00,  0x80,  0x01,  0x00,  0x00,  0x80,  0x01,  0x00,
-	0x00,  0x80,  0x01,  0x00,  0x00,  0x80,  0x01,  0x00,
-	0x00,  0x80,  0x01,  0x00,  0x00,  0x80,  0x01,  0x00,
-	0x00,  0x80,  0x01,  0x00,  0x00,  0x80,  0x01,  0x00,
-	0x00,  0x80,  0x01,  0x00,  0x00,  0xc0,  0x03,  0x00,
-	0x00,  0xe0,  0x07,  0x00,  0x00,  0x70,  0x0e,  0x00,
-	0x00,  0x78,  0x1e,  0x00,  0xff,  0x1f,  0xf8,  0xff,
-	0xff,  0x1f,  0xf8,  0xff,  0x00,  0x78,  0x1e,  0x00,
-	0x00,  0x70,  0x0e,  0x00,  0x00,  0xe0,  0x07,  0x00,
-	0x00,  0xc0,  0x03,  0x00,  0x00,  0x80,  0x01,  0x00,
-	0x00,  0x80,  0x01,  0x00,  0x00,  0x80,  0x01,  0x00,
-	0x00,  0x80,  0x01,  0x00,  0x00,  0x80,  0x01,  0x00,
-	0x00,  0x80,  0x01,  0x00,  0x00,  0x80,  0x01,  0x00,
-	0x00,  0x80,  0x01,  0x00,  0x00,  0x80,  0x01,  0x00,
-	0x00,  0x80,  0x01,  0x00,  0x00,  0x80,  0x01,  0x00,
-};
-
-static BCursor RingCursor = {
-	/*small*/
-	ring_sbm, ring_smsk,
-	16, 16,
-	8,  8,
-	/*big*/
-	ring_lbm, ring_lmsk,
-	32, 32,
-	15, 15,
-	/*color*/
-	BC_BLACK, BC_WHITE
-};
-
-BlenderCursor[BC_RING_CURSOR] = &RingCursor;
-END_CURSOR_BLOCK
-
 /********************** Put the cursors in the array ***********************/
 
 }
diff --git a/source/blender/windowmanager/wm_cursors.h b/source/blender/windowmanager/wm_cursors.h
index 1ac72b34765..f863d8bfdd9 100644
--- a/source/blender/windowmanager/wm_cursors.h
+++ b/source/blender/windowmanager/wm_cursors.h
@@ -94,7 +94,6 @@ enum {
 	BC_EW_SCROLLCURSOR,
 	BC_EYEDROPPER_CURSOR,
 	BC_SWAPAREA_CURSOR,
-	BC_RING_CURSOR,
 /* --- ALWAYS LAST ----- */
 	BC_NUMCURSORS,
 };



More information about the Bf-blender-cvs mailing list