mask selection invert wasnt working.
authorCampbell Barton <ideasman42@gmail.com>
Wed, 1 Aug 2012 13:34:20 +0000 (13:34 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 1 Aug 2012 13:34:20 +0000 (13:34 +0000)
source/blender/editors/mask/mask_select.c

index 9c1b4f0fd425fc0cc13c6c14f0234941449b249e..e746f4258a5d7d35358efb3b1b98659cce7faa20 100644 (file)
@@ -147,7 +147,26 @@ void ED_mask_select_toggle_all(Mask *mask, int action)
                        continue;
                }
 
-               ED_mask_layer_select_set(masklay, (action == SEL_SELECT) ? TRUE : FALSE);
+               if (action == SEL_INVERT) {
+                       /* we don't have generic functons for this, its restricted to this operator
+                        * if one day we need to re-use such functionality, they can be split out */
+
+                       MaskSpline *spline;
+                       if (masklay->restrictflag & MASK_RESTRICT_SELECT) {
+                               continue;
+                       }
+                       for (spline = masklay->splines.first; spline; spline = spline->next) {
+                               int i;
+                               for (i = 0; i < spline->tot_point; i++) {
+                                       MaskSplinePoint *point = &spline->points[i];
+                                       BKE_mask_point_select_set(point, !MASKPOINT_ISSEL_ANY(point));
+                               }
+                       }
+
+               }
+               else {
+                       ED_mask_layer_select_set(masklay, (action == SEL_SELECT) ? TRUE : FALSE);
+               }
        }
 }