Fix loading of GIF files with transparent background color (without global palette).

This commit is contained in:
David Capello 2011-01-15 13:36:33 -03:00
parent 68a8907ffc
commit 8b6b51bec2

View File

@ -118,7 +118,13 @@ static bool load_GIF(FileOp *fop)
}
sprite->getFolder()->add_layer(layer);
layer->configureAsBackground();
// If the GIF image has a global palette (colors_count > 0), it has
// a valid background_index color.
if (gif->palette.colors_count > 0)
layer->configureAsBackground();
else
gif->background_index = 0;
image_clear(current_image, gif->background_index);
image_clear(current_image_old, gif->background_index);