Fix brush preview hiding from secondary editors when we change the current frame

This commit is contained in:
David Capello 2015-08-14 10:15:38 -03:00
parent 75a743f141
commit 953a626425
2 changed files with 7 additions and 4 deletions

View File

@ -192,7 +192,8 @@ void BrushPreview::show(const gfx::Point& screenPos)
}
document->notifySpritePixelsModified(
sprite, gfx::Region(m_lastBounds = brushBounds), site.frame());
sprite, gfx::Region(m_lastBounds = brushBounds),
m_lastFrame = site.frame());
m_withRealPreview = true;
}
@ -246,11 +247,9 @@ void BrushPreview::hide()
// Clean pixel/brush preview
if (m_withRealPreview) {
frame_t frame = document->getExtraCel()->frame();
document->destroyExtraCel();
document->notifySpritePixelsModified(
sprite, gfx::Region(m_lastBounds), frame);
sprite, gfx::Region(m_lastBounds), m_lastFrame);
m_withRealPreview = false;
}

View File

@ -11,6 +11,7 @@
#include "base/shared_ptr.h"
#include "doc/color.h"
#include "doc/frame.h"
#include "doc/mask_boundaries.h"
#include "gfx/color.h"
#include "gfx/point.h"
@ -102,7 +103,10 @@ namespace app {
gfx::Region m_clippingRegion;
gfx::Region m_oldClippingRegion;
// Information stored in show() and used in hide() to clear the
// brush preview in the exact same place.
gfx::Rect m_lastBounds;
doc::frame_t m_lastFrame;
};
class HideBrushPreview {