Fix bug showing invalid areas when drawing/scrolling with zoom > 100%

This commit is contained in:
David Capello 2015-02-15 17:39:14 -03:00
parent 1a74326536
commit 86d8975e92

View File

@ -380,8 +380,16 @@ void Editor::drawOneSpriteUnclippedRect(ui::Graphics* g, const gfx::Rect& sprite
// the exposed area. Those pixels could be shown in the
// rendering process depending on each cel position.
// E.g. when we are drawing in a cel with position < (0,0)
if (m_zoom.scale() < 1.0)
if (m_zoom.scale() < 1.0) {
expose.enlarge(int(1./m_zoom.scale()));
}
// If the zoom level is more than %100 we add an extra pixel to
// expose just in case the zoom requires to display it. Note:
// this is really necessary to avoid showing invalid destination
// areas in ToolLoopImpl.
else if (m_zoom.scale() > 1.0) {
expose.enlarge(1);
}
m_document->notifyExposeSpritePixels(m_sprite, gfx::Region(expose));
}