Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-08-07 17:37:16 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-07 17:37:16 +0400
commit719aedaf60ecbf2108117d9377acb2f1614cc7cd (patch)
tree2348883e327d5b02a142bddb773756507183aa6e /source/blender/editors/mask
parentfcc18fe5e394a440a73fbfebf22d99bff5a095e4 (diff)
mask - draw both sides of the curve when `filled` option is disabled.
Diffstat (limited to 'source/blender/editors/mask')
-rw-r--r--source/blender/editors/mask/mask_draw.c21
1 files changed, 20 insertions, 1 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);