diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-08-07 17:37:16 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-08-07 17:37:16 +0400 |
commit | 719aedaf60ecbf2108117d9377acb2f1614cc7cd (patch) | |
tree | 2348883e327d5b02a142bddb773756507183aa6e /source/blender | |
parent | fcc18fe5e394a440a73fbfebf22d99bff5a095e4 (diff) |
mask - draw both sides of the curve when `filled` option is disabled.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/mask/mask_draw.c | 21 | ||||
-rw-r--r-- | source/blender/python/intern/bpy_props.c | 2 |
2 files changed, 21 insertions, 2 deletions
diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c index 2f5a918a488..703ae70eb0f 100644 --- a/source/blender/editors/mask/mask_draw.c +++ b/source/blender/editors/mask/mask_draw.c @@ -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); diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index f9c39ad24b0..abf609cd235 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -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); |