diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-06-20 22:46:18 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-06-20 22:46:18 +0400 |
commit | 850d73414716351421245102f4d2255691987b8a (patch) | |
tree | 7f8593be94b1e06898def421a37d94978e07c56a /source/blender/editors | |
parent | dc7770d1a13af0946b8904bf5dd3a1a03604c8d5 (diff) |
make mask handles draw with an outline - when outline option is enabled.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/mask/mask_draw.c | 21 | ||||
-rw-r--r-- | source/blender/editors/space_view3d/view3d_draw.c | 5 |
2 files changed, 22 insertions, 4 deletions
diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c index 71d3caf74c5..83337a18223 100644 --- a/source/blender/editors/mask/mask_draw.c +++ b/source/blender/editors/mask/mask_draw.c @@ -116,7 +116,8 @@ static void draw_spline_parents(MaskLayer *UNUSED(masklay), MaskSpline *spline) #endif /* return non-zero if spline is selected */ -static void draw_spline_points(MaskLayer *masklay, MaskSpline *spline) +static void draw_spline_points(MaskLayer *masklay, MaskSpline *spline, + const char UNUSED(draw_flag), const char draw_type) { const int is_spline_sel = (spline->flag & SELECT) && (masklay->restrictflag & MASK_RESTRICT_SELECT) == 0; unsigned char rgb_spline[4]; @@ -188,8 +189,20 @@ static void draw_spline_points(MaskLayer *masklay, MaskSpline *spline) /* draw handle segment */ if (has_handle) { - glColor3ubv(rgb_spline); + /* this could be split into its own loop */ + if (draw_type == MASK_DT_OUTLINE) { + const unsigned char rgb_grey[4] = {0x60, 0x60, 0x60, 0xff}; + glLineWidth(3); + glColor4ubv(rgb_grey); + glBegin(GL_LINES); + glVertex3fv(vert); + glVertex3fv(handle); + glEnd(); + glLineWidth(1); + } + + glColor3ubv(rgb_spline); glBegin(GL_LINES); glVertex3fv(vert); glVertex3fv(handle); @@ -415,7 +428,7 @@ static void draw_masklays(Mask *mask, const char draw_flag, const char draw_type if (!(masklay->restrictflag & MASK_RESTRICT_SELECT)) { /* ...and then handles over the curve so they're nicely visible */ - draw_spline_points(masklay, spline); + draw_spline_points(masklay, spline, draw_flag, draw_type); } /* show undeform for testing */ @@ -425,7 +438,7 @@ static void draw_masklays(Mask *mask, const char draw_flag, const char draw_type spline->points_deform = NULL; draw_spline_curve(masklay, spline, draw_flag, draw_type, is_active, width, height); // draw_spline_parents(masklay, spline); - draw_spline_points(masklay, spline); + draw_spline_points(masklay, spline, draw_flag, draw_type); spline->points_deform = back; } } diff --git a/source/blender/editors/space_view3d/view3d_draw.c b/source/blender/editors/space_view3d/view3d_draw.c index 709a73178aa..709de274b8b 100644 --- a/source/blender/editors/space_view3d/view3d_draw.c +++ b/source/blender/editors/space_view3d/view3d_draw.c @@ -1589,6 +1589,11 @@ static void view3d_draw_bgpic(Scene *scene, ARegion *ar, View3D *v3d, * be dereferenced after usage. */ freeibuf = ibuf; } + else { + /* perhaps when loading future files... */ + BLI_assert(0); + copy_v2_fl(image_aspect, 1.0f); + } if (ibuf == NULL) continue; |