Redraw editor when symmetry is enabled/disabled

This redraw issue appears when we assign a key to switch the global
symmetry visibility (SymmetryModeCommand).
This commit is contained in:
David Capello 2015-12-22 19:05:11 -03:00
parent 07c3853bab
commit ff507af308
2 changed files with 10 additions and 0 deletions

View File

@ -197,6 +197,7 @@ Editor::Editor(Document* document, EditorFlags flags)
m_pixelGridConn = docPref.pixelGrid.AfterChange.connect(base::Bind<void>(&Editor::invalidate, this));
m_bgConn = docPref.bg.AfterChange.connect(base::Bind<void>(&Editor::invalidate, this));
m_onionskinConn = docPref.onionskin.AfterChange.connect(base::Bind<void>(&Editor::invalidate, this));
m_symmetryModeConn = Preferences::instance().symmetryMode.enabled.AfterChange.connect(base::Bind<void>(&Editor::invalidateIfActive, this));
m_document->addObserver(this);
@ -1713,4 +1714,10 @@ void Editor::dropMovingPixels()
backToPreviousState();
}
void Editor::invalidateIfActive()
{
if (isActive())
invalidate();
}
} // namespace app

View File

@ -249,6 +249,8 @@ namespace app {
gfx::Point calcExtraPadding(const render::Zoom& zoom);
void invalidateIfActive();
// Stack of states. The top element in the stack is the current state (m_state).
EditorStatesHistory m_statesHistory;
@ -300,6 +302,7 @@ namespace app {
base::ScopedConnection m_pixelGridConn;
base::ScopedConnection m_bgConn;
base::ScopedConnection m_onionskinConn;
base::ScopedConnection m_symmetryModeConn;
EditorObservers m_observers;