From 618690b05eff11ffccb92e3667368d4fd6a590d7 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 12 Apr 2011 10:13:09 +0000 Subject: modify the method for calculating ghost alpha. * ghost frame 1 did nothing (alpha 0.0). * was subtracting alpha from the existing alpha which could end up with negative alpha. * with larger frame ranges the frames on each size would get too close to being the same as the active frames alpha, use 66% alpha for all non-active frames as well as time based falloff. --- source/blender/editors/gpencil/drawgpencil.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'source/blender/editors/gpencil') diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c index 7abdb1f8f07..74e7cae93f5 100644 --- a/source/blender/editors/gpencil/drawgpencil.c +++ b/source/blender/editors/gpencil/drawgpencil.c @@ -601,8 +601,8 @@ static void gp_draw_data (bGPdata *gpd, int offsx, int offsy, int winx, int winy /* check if frame is drawable */ if ((gpf->framenum - gf->framenum) <= gpl->gstep) { /* alpha decreases with distance from curframe index */ - fac= (float)(gpf->framenum - gf->framenum) / (float)gpl->gstep; - tcolor[3] = color[3] - fac; + fac= 1.0f - ((float)(gpf->framenum - gf->framenum) / (float)(gpl->gstep + 1)); + tcolor[3] = color[3] * fac * 0.66f; gp_draw_strokes(gf, offsx, offsy, winx, winy, dflag, debug, lthick, tcolor); } else @@ -614,8 +614,8 @@ static void gp_draw_data (bGPdata *gpd, int offsx, int offsy, int winx, int winy /* check if frame is drawable */ if ((gf->framenum - gpf->framenum) <= gpl->gstep) { /* alpha decreases with distance from curframe index */ - fac= (float)(gf->framenum - gpf->framenum) / (float)gpl->gstep; - tcolor[3] = color[3] - fac; + fac= 1.0f - ((float)(gf->framenum - gpf->framenum) / (float)(gpl->gstep + 1)); + tcolor[3] = color[3] * fac * 0.66f; gp_draw_strokes(gf, offsx, offsy, winx, winy, dflag, debug, lthick, tcolor); } else -- cgit v1.2.3