fix for selecting UW's
authorCampbell Barton <ideasman42@gmail.com>
Mon, 4 Jun 2012 08:01:59 +0000 (08:01 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 4 Jun 2012 08:01:59 +0000 (08:01 +0000)
source/blender/editors/mask/mask_select.c

index 95c2808bc3e8af322fb06eb091a1b2dfad1e6359..323721e2dfe48d70cc77f776a4f3aafd8aebbe11 100644 (file)
@@ -240,9 +240,10 @@ static int select_exec(bContext *C, wmOperator *op)
 
        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,14 +303,29 @@ static int select_exec(bContext *C, wmOperator *op)
                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);