Fix paint bucket and magic wand tools for tilemaps

This commit is contained in:
David Capello 2019-11-05 11:18:38 -03:00
parent 559a244e6a
commit a6302b91f7

View File

@ -431,14 +431,27 @@ public:
else {
Cel* cel = m_layer->cel(m_frame);
if (cel && (cel->x() != 0 || cel->y() != 0)) {
m_floodfillSrcImage = Image::create(m_sprite->pixelFormat(),
m_sprite->width(),
m_sprite->height());
m_floodfillSrcImage = Image::create(m_sprite->spec());
m_floodfillSrcImage->clear(m_sprite->transparentColor());
if (cel->image()->pixelFormat() == IMAGE_TILEMAP) {
render::Render render;
render.setNewBlend(Preferences::instance().experimental.newBlend());
render.renderCel(
m_floodfillSrcImage,
m_sprite,
cel->image(),
m_layer,
m_sprite->palette(m_frame),
gfx::RectF(cel->bounds()),
gfx::Clip(m_sprite->bounds()),
255, BlendMode::NORMAL);
}
else {
copy_image(m_floodfillSrcImage, cel->image(), cel->x(), cel->y());
}
}
}
}
m_expandCelCanvas = new ExpandCelCanvas(
site, site.layer(),