[Bf-blender-cvs] [e45a9a3] master: Radial control operator support for pixel properties

Antony Riakiotakis noreply at git.blender.org
Thu Dec 12 19:07:53 CET 2013


Commit: e45a9a3aaa17f585160e1ac7cbab2eead793f84d
Author: Antony Riakiotakis
Date:   Thu Dec 12 20:07:16 2013 +0200
http://developer.blender.org/rBe45a9a3aaa17f585160e1ac7cbab2eead793f84d

Radial control operator support for pixel properties

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

M	source/blender/windowmanager/intern/wm_operators.c

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

diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index ac32d16..f17dc29 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -3536,6 +3536,7 @@ static void radial_control_set_initial_mouse(RadialControl *rc, const wmEvent *e
 	switch (rc->subtype) {
 		case PROP_NONE:
 		case PROP_DISTANCE:
+		case PROP_PIXEL:
 			d[0] = rc->initial_value;
 			break;
 		case PROP_FACTOR:
@@ -3636,6 +3637,7 @@ static void radial_control_paint_cursor(bContext *C, int x, int y, void *customd
 	switch (rc->subtype) {
 		case PROP_NONE:
 		case PROP_DISTANCE:
+		case PROP_PIXEL:
 			r1 = rc->current_value;
 			r2 = rc->initial_value;
 			tex_radius = r1;
@@ -3880,7 +3882,7 @@ static int radial_control_invoke(bContext *C, wmOperator *op, const wmEvent *eve
 
 	/* get subtype of property */
 	rc->subtype = RNA_property_subtype(rc->prop);
-	if (!ELEM4(rc->subtype, PROP_NONE, PROP_DISTANCE, PROP_FACTOR, PROP_ANGLE)) {
+	if (!ELEM5(rc->subtype, PROP_NONE, PROP_DISTANCE, PROP_FACTOR, PROP_ANGLE, PROP_PIXEL)) {
 		BKE_report(op->reports, RPT_ERROR, "Property must be a none, distance, a factor, or an angle");
 		MEM_freeN(rc);
 		return OPERATOR_CANCELLED;
@@ -3965,6 +3967,7 @@ static int radial_control_modal(bContext *C, wmOperator *op, const wmEvent *even
 			switch (rc->subtype) {
 				case PROP_NONE:
 				case PROP_DISTANCE:
+				case PROP_PIXEL:
 					new_value = dist;
 					if (snap) new_value = ((int)new_value + 5) / 10 * 10;
 					break;




More information about the Bf-blender-cvs mailing list