origin(0,0),
depth(0),
zoom(0),
- time_offset(0)
+ time_offset(0),
+ extra_reference(false)
{
children_lock=false;
muck_with_time_=true;
set_sub_canvas(0);
//if(canvas && (canvas->is_inline() || !get_canvas() || get_canvas()->get_root()!=canvas->get_root()))
+ //if(extra_reference)
// canvas->unref();
}
if(canvas && muck_with_time_)
remove_child(canvas.get());
- if(canvas && (canvas->is_inline() || !get_canvas() || get_canvas()->get_root()!=canvas->get_root()))
+ // if(canvas && (canvas->is_inline() || !get_canvas() || get_canvas()->get_root()!=canvas->get_root()))
+ if (extra_reference)
canvas->unref();
child_changed_connection.disconnect();
add_child(canvas.get());
if(canvas && (canvas->is_inline() || !get_canvas() || get_canvas()->get_root()!=canvas->get_root()))
+ {
canvas->ref();
+ extra_reference = true;
+ }
+ else
+ extra_reference = false;
if(canvas)
on_canvas_set();
// '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;
// 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)