Tidied up and checked in a patch from genete to allow importing of lipsynced voice...
[synfig.git] / synfig-core / trunk / src / synfig / layer_pastecanvas.cpp
index d68a619..04ed8b9 100644 (file)
@@ -392,7 +392,7 @@ Layer_PasteCanvas::accelerated_render(Context context,Surface *surface,int quali
        // 'straight', then we need to blend transparent pixels with the
        // clipped areas of this tile, because with the 'straight' blend
        // method, even transparent pixels have an effect on the layers below
-       if (blend_method == Color::BLEND_STRAIGHT || blend_method == Color::BLEND_STRAIGHT_ONTO)
+       if (Color::is_straight(blend_method))
        {
                Surface clearsurface;
 
@@ -401,7 +401,10 @@ Layer_PasteCanvas::accelerated_render(Context context,Surface *surface,int quali
 
                // the area we're about to blit is transparent, so it doesn't
                // matter whether we use 'straight' or 'straight onto' here
-               apen.set_blend_method(Color::BLEND_STRAIGHT);
+               if (blend_method == Color::BLEND_ALPHA_BRIGHTEN)
+                       apen.set_blend_method(blend_method);
+               else
+                       apen.set_blend_method(Color::BLEND_STRAIGHT);
 
                /* This represents the area we're pasting into the tile,
                 * within the tile as a whole.  Areas (A), (B), (C) and (D)