Transform: show arrows for 'custom' ratio input
Arrows are now shown for vertex/edge slide.
This commit is contained in:
		@@ -1926,6 +1926,29 @@ static void drawHelpline(bContext *C, int x, int y, void *customdata)
 | 
			
		||||
				drawArrow(UP, 5, 10, 5);
 | 
			
		||||
				drawArrow(DOWN, 5, 10, 5);
 | 
			
		||||
				break;
 | 
			
		||||
			case HLP_CARROW:
 | 
			
		||||
			{
 | 
			
		||||
				/* Draw arrow based on direction defined by custom-points. */
 | 
			
		||||
				immUniformThemeColor(TH_VIEW_OVERLAY);
 | 
			
		||||
 | 
			
		||||
				GPU_matrix_translate_3fv(mval);
 | 
			
		||||
 | 
			
		||||
				GPU_line_width(3.0f);
 | 
			
		||||
 | 
			
		||||
				const int *data = t->mouse.data;
 | 
			
		||||
				const float dx = data[2] - data[0], dy = data[3] - data[1];
 | 
			
		||||
				const float angle = -atan2f(dx, dy);
 | 
			
		||||
 | 
			
		||||
				GPU_matrix_push();
 | 
			
		||||
 | 
			
		||||
				GPU_matrix_rotate_axis(RAD2DEGF(angle), 'Z');
 | 
			
		||||
 | 
			
		||||
				drawArrow(UP, 5, 10, 5);
 | 
			
		||||
				drawArrow(DOWN, 5, 10, 5);
 | 
			
		||||
 | 
			
		||||
				GPU_matrix_pop();
 | 
			
		||||
				break;
 | 
			
		||||
			}
 | 
			
		||||
			case HLP_ANGLE:
 | 
			
		||||
			{
 | 
			
		||||
				float dx = tmval[0] - cent[0], dy = tmval[1] - cent[1];
 | 
			
		||||
 
 | 
			
		||||
@@ -633,7 +633,8 @@ typedef struct TransInfo {
 | 
			
		||||
#define HLP_ANGLE		2
 | 
			
		||||
#define HLP_HARROW		3
 | 
			
		||||
#define HLP_VARROW		4
 | 
			
		||||
#define HLP_TRACKBALL	5
 | 
			
		||||
#define HLP_CARROW		5
 | 
			
		||||
#define HLP_TRACKBALL	6
 | 
			
		||||
 | 
			
		||||
/* transinfo->con->mode */
 | 
			
		||||
#define CON_APPLY		1
 | 
			
		||||
 
 | 
			
		||||
@@ -332,11 +332,11 @@ void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode)
 | 
			
		||||
			break;
 | 
			
		||||
		case INPUT_CUSTOM_RATIO:
 | 
			
		||||
			mi->apply = InputCustomRatio;
 | 
			
		||||
			t->helpline = HLP_NONE;
 | 
			
		||||
			t->helpline = HLP_CARROW;
 | 
			
		||||
			break;
 | 
			
		||||
		case INPUT_CUSTOM_RATIO_FLIP:
 | 
			
		||||
			mi->apply = InputCustomRatioFlip;
 | 
			
		||||
			t->helpline = HLP_NONE;
 | 
			
		||||
			t->helpline = HLP_CARROW;
 | 
			
		||||
			break;
 | 
			
		||||
		case INPUT_NONE:
 | 
			
		||||
		default:
 | 
			
		||||
@@ -360,6 +360,7 @@ void initMouseInputMode(TransInfo *t, MouseInput *mi, MouseInputMode mode)
 | 
			
		||||
		case HLP_TRACKBALL:
 | 
			
		||||
		case HLP_HARROW:
 | 
			
		||||
		case HLP_VARROW:
 | 
			
		||||
		case HLP_CARROW:
 | 
			
		||||
			if (t->flag & T_MODAL) {
 | 
			
		||||
				t->flag |= T_MODAL_CURSOR_SET;
 | 
			
		||||
				WM_cursor_modal_set(win, CURSOR_NONE);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user