[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [47396] branches/soc-2011-tomato/source/ blender/editors/mask/mask_select.c: fix for selecting UW's

Campbell Barton ideasman42 at gmail.com
Mon Jun 4 10:02:09 CEST 2012


Revision: 47396
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=47396
Author:   campbellbarton
Date:     2012-06-04 08:01:59 +0000 (Mon, 04 Jun 2012)
Log Message:
-----------
fix for selecting UW's

Modified Paths:
--------------
    branches/soc-2011-tomato/source/blender/editors/mask/mask_select.c

Modified: branches/soc-2011-tomato/source/blender/editors/mask/mask_select.c
===================================================================
--- branches/soc-2011-tomato/source/blender/editors/mask/mask_select.c	2012-06-04 07:48:10 UTC (rev 47395)
+++ branches/soc-2011-tomato/source/blender/editors/mask/mask_select.c	2012-06-04 08:01:59 UTC (rev 47396)
@@ -240,9 +240,10 @@
 
 	point = ED_mask_point_find_nearest(C, mask, co, threshold, &masklay, &spline, &is_handle, NULL);
 
+	if (extend == 0 && deselect == 0 && toggle == 0)
+		ED_mask_select_toggle_all(mask, SEL_DESELECT);
+
 	if (point) {
-		if (extend == 0 && deselect == 0 && toggle == 0)
-			ED_mask_select_toggle_all(mask, SEL_DESELECT);
 
 		if (is_handle) {
 			if (extend) {
@@ -302,15 +303,30 @@
 		MaskSplinePointUW *uw;
 
 		if (ED_mask_feather_find_nearest(C, mask, co, threshold, &masklay, &spline, &point, &uw, NULL)) {
-			if (!extend)
-				ED_mask_select_toggle_all(mask, SEL_DESELECT);
 
-			if (uw)
-				uw->flag |= SELECT;
+			if (extend) {
+				masklay->act_spline = spline;
+				masklay->act_point = point;
 
-			masklay->act_spline = spline;
-			masklay->act_point = point;
+				if (uw) uw->flag |= SELECT;
+			}
+			else if (deselect) {
+				if (uw) uw->flag &= ~SELECT;
+			}
+			else {
+				masklay->act_spline = spline;
+				masklay->act_point = point;
 
+				if (uw) {
+					if (!(uw->flag & SELECT)) {
+						uw->flag |= SELECT;
+					}
+					else if (toggle) {
+						uw->flag &= ~SELECT;
+					}
+				}
+			}
+
 			ED_mask_select_flush_all(mask);
 
 			WM_event_add_notifier(C, NC_MASK | ND_SELECT, mask);




More information about the Bf-blender-cvs mailing list