X-Git-Url: https://cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Ftitler%2Ftitler.C;h=7655b5a3c8a15b01ea36c1d1a584538919e55985;hb=561059992b5e4e86217c33109f9946e33f2d3a87;hp=37582050c4146dc447e451de2895aca71a9e32f3;hpb=6bc0a304ee802c8d05bf9faadd17229696fec5d3;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/plugins/titler/titler.C b/cinelerra-5.1/plugins/titler/titler.C index 37582050..7655b5a3 100644 --- a/cinelerra-5.1/plugins/titler/titler.C +++ b/cinelerra-5.1/plugins/titler/titler.C @@ -2280,10 +2280,12 @@ TitleTranslateUnit::TitleTranslateUnit(TitleMain *plugin, TitleTranslate *server else b = max - a; \ double_b = (1.0 * b * (max - a)/(max*1.0)); \ total_alpha = a + double_b; \ - px = *op; *op++ = (a*in_r + double_b*px) / total_alpha; \ - px = *op; *op++ = (a*(in_g-ofs) + double_b*(px-ofs)) / total_alpha + ofs; \ - px = *op; *op++ = (a*(in_b-ofs) + double_b*(px-ofs)) / total_alpha + ofs; \ - if( comps == 4 ) { b = *op; *op++ = a + b - a*b / max; } \ + if (total_alpha > 0.00000001) { \ + px = *op; *op++ = (a*in_r + double_b*px) / total_alpha; \ + px = *op; *op++ = (a*(in_g-ofs) + double_b*(px-ofs)) / total_alpha + ofs; \ + px = *op; *op++ = (a*(in_b-ofs) + double_b*(px-ofs)) / total_alpha + ofs; \ + if( comps == 4 ) { b = *op; *op++ = a + b - a*b / max; } \ + } \ } \ } \ }