mask - draw both sides of the curve when `filled` option is disabled.
authorCampbell Barton <ideasman42@gmail.com>
Tue, 7 Aug 2012 13:37:16 +0000 (13:37 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 7 Aug 2012 13:37:16 +0000 (13:37 +0000)
source/blender/editors/mask/mask_draw.c
source/blender/python/intern/bpy_props.c

index 2f5a918a488746904a29445a43277fa4982f2671..703ae70eb0f7dbc99d155a5781ddc0ee2b261a62 100644 (file)
@@ -368,6 +368,7 @@ static void draw_spline_curve(MaskLayer *masklay, MaskSpline *spline,
 
        const short is_spline_sel = (spline->flag & SELECT) && (masklay->restrictflag & MASK_RESTRICT_SELECT) == 0;
        const short is_smooth = (draw_flag & MASK_DRAWFLAG_SMOOTH);
+       const short is_fill = (spline->flag & MASK_SPLINE_NOFILL) == 0;
 
        int tot_diff_point;
        float (*diff_points)[2];
@@ -394,7 +395,25 @@ static void draw_spline_curve(MaskLayer *masklay, MaskSpline *spline,
                             TRUE, is_smooth, is_active,
                             rgb_tmp, draw_type);
 
-       /* TODO, draw mirror values when MASK_SPLINE_NOFILL is set */
+       if (!is_fill) {
+
+               float *fp         = &diff_points[0][0];
+               float *fp_feather = &feather_points[0][0];
+               float tvec[2];
+               int i;
+
+               BLI_assert(tot_diff_point == tot_feather_point);
+
+               for (i = 0; i < tot_diff_point; i++, fp += 2, fp_feather += 2) {
+                       sub_v2_v2v2(tvec, fp, fp_feather);
+                       add_v2_v2v2(fp_feather, fp, tvec);
+               }
+
+               /* same as above */
+               mask_draw_curve_type(spline, feather_points, tot_feather_point,
+                                    TRUE, is_smooth, is_active,
+                                    rgb_tmp, draw_type);
+       }
 
        MEM_freeN(feather_points);
 
index f9c39ad24b0e8e3029972f304831fa05c4fac95d..abf609cd23542e01e78540badd7399048f23f744 100644 (file)
@@ -1327,7 +1327,7 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw)
 
                if (is_itemf == FALSE) {
                        /* note: this must be postponed until after #RNA_def_property_duplicate_pointers
-                        * otherwise if this is a generator it may free the strings before we get copy them */
+                        * otherwise if this is a generator it may free the strings before we copy them */
                        Py_DECREF(items_fast);
 
                        MEM_freeN(eitems);