mirror of
https://github.com/aseprite/aseprite.git
synced 2025-02-06 03:39:51 +00:00
Now mini editor's frame is synced with current editor's frame
This commit is contained in:
parent
dbffd6c42a
commit
163af12313
@ -60,14 +60,18 @@ public:
|
||||
App::instance()->getMainWindow()->getMiniEditor()->updateUsingEditor(NULL);
|
||||
}
|
||||
|
||||
void scrollChanged(Editor* editor) OVERRIDE {
|
||||
void onScrollChanged(Editor* editor) OVERRIDE {
|
||||
App::instance()->getMainWindow()->getMiniEditor()->updateUsingEditor(this);
|
||||
}
|
||||
|
||||
void stateChanged(Editor* editor) OVERRIDE {
|
||||
void onStateChanged(Editor* editor) OVERRIDE {
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
void onFrameChanged(Editor* editor) OVERRIDE {
|
||||
App::instance()->getMainWindow()->getMiniEditor()->updateUsingEditor(this);
|
||||
}
|
||||
|
||||
// EditorCustomizationDelegate implementation
|
||||
tools::Tool* getQuickTool(tools::Tool* currentTool) OVERRIDE {
|
||||
return get_selected_quicktool(currentTool);
|
||||
|
@ -248,6 +248,7 @@ void Editor::setFrame(FrameNumber frame)
|
||||
{
|
||||
if (m_frame != frame) {
|
||||
m_frame = frame;
|
||||
m_observers.notifyFrameChanged(this);
|
||||
|
||||
invalidate();
|
||||
updateStatusBar();
|
||||
|
@ -28,10 +28,13 @@ public:
|
||||
virtual void dispose() = 0;
|
||||
|
||||
// Called when the editor's state changes.
|
||||
virtual void stateChanged(Editor* editor) = 0;
|
||||
virtual void onStateChanged(Editor* editor) = 0;
|
||||
|
||||
// Called when the scroll or zoom of the editor changes.
|
||||
virtual void scrollChanged(Editor* editor) = 0;
|
||||
virtual void onScrollChanged(Editor* editor) = 0;
|
||||
|
||||
// Called when the current frame of the editor changes.
|
||||
virtual void onFrameChanged(Editor* editor) = 0;
|
||||
};
|
||||
|
||||
#endif // WIDGETS_EDITOR_OBSERVER_H_INCLUDED
|
||||
|
@ -39,10 +39,15 @@ void EditorObservers::removeObserver(EditorObserver* observer)
|
||||
|
||||
void EditorObservers::notifyStateChanged(Editor* editor)
|
||||
{
|
||||
m_observers.notifyObservers(&EditorObserver::stateChanged, editor);
|
||||
m_observers.notifyObservers(&EditorObserver::onStateChanged, editor);
|
||||
}
|
||||
|
||||
void EditorObservers::notifyScrollChanged(Editor* editor)
|
||||
{
|
||||
m_observers.notifyObservers(&EditorObserver::scrollChanged, editor);
|
||||
m_observers.notifyObservers(&EditorObserver::onScrollChanged, editor);
|
||||
}
|
||||
|
||||
void EditorObservers::notifyFrameChanged(Editor* editor)
|
||||
{
|
||||
m_observers.notifyObservers(&EditorObserver::onFrameChanged, editor);
|
||||
}
|
||||
|
@ -34,6 +34,7 @@ public:
|
||||
|
||||
void notifyStateChanged(Editor* editor);
|
||||
void notifyScrollChanged(Editor* editor);
|
||||
void notifyFrameChanged(Editor* editor);
|
||||
|
||||
private:
|
||||
Observers<EditorObserver> m_observers;
|
||||
|
@ -210,6 +210,7 @@ void MiniEditorWindow::updateUsingEditor(Editor* editor)
|
||||
}
|
||||
|
||||
miniEditor->centerInSpritePoint(pt.x, pt.y);
|
||||
miniEditor->setFrame(editor->getFrame());
|
||||
}
|
||||
else {
|
||||
hideWindow();
|
||||
|
Loading…
x
Reference in New Issue
Block a user