mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-14 04:19:12 +00:00
Fix bug switching current fg color (X key) and updating Editor's brush preview.
This commit is contained in:
parent
2b95ba58d2
commit
2835d642a0
@ -25,6 +25,7 @@
|
||||
#include "app.h"
|
||||
#include "app/color.h"
|
||||
#include "app/color_utils.h"
|
||||
#include "base/bind.h"
|
||||
#include "commands/commands.h"
|
||||
#include "commands/params.h"
|
||||
#include "document_wrappers.h"
|
||||
@ -139,6 +140,9 @@ Editor::Editor()
|
||||
|
||||
m_currentToolChangeSlot =
|
||||
App::instance()->CurrentToolChange.connect(&Editor::onCurrentToolChange, this);
|
||||
|
||||
m_fgColorChangeSlot =
|
||||
app_get_colorbar()->FgColorChange.connect(Bind<void>(&Editor::onFgColorChange, this));
|
||||
}
|
||||
|
||||
Editor::~Editor()
|
||||
@ -149,6 +153,10 @@ Editor::~Editor()
|
||||
// Remove this editor as listener of CurrentToolChange signal.
|
||||
App::instance()->CurrentToolChange.disconnect(m_currentToolChangeSlot);
|
||||
delete m_currentToolChangeSlot;
|
||||
|
||||
// Remove this editor as listener of FgColorChange
|
||||
app_get_colorbar()->FgColorChange.disconnect(m_fgColorChangeSlot);
|
||||
delete m_fgColorChangeSlot;
|
||||
}
|
||||
|
||||
int editor_type()
|
||||
@ -992,6 +1000,14 @@ void Editor::onCurrentToolChange()
|
||||
m_state->onCurrentToolChange(this);
|
||||
}
|
||||
|
||||
void Editor::onFgColorChange()
|
||||
{
|
||||
if (m_cursor_thick) {
|
||||
hideDrawingCursor();
|
||||
showDrawingCursor();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns size for the editor viewport
|
||||
*/
|
||||
|
@ -164,6 +164,7 @@ public:
|
||||
protected:
|
||||
bool onProcessMessage(Message* msg) OVERRIDE;
|
||||
void onCurrentToolChange();
|
||||
void onFgColorChange();
|
||||
|
||||
// Returns true if this editor should change the preferred document
|
||||
// settings.
|
||||
@ -220,6 +221,8 @@ private:
|
||||
// signals).
|
||||
Slot0<void>* m_currentToolChangeSlot;
|
||||
|
||||
Slot1<void, const Color&>* m_fgColorChangeSlot;
|
||||
|
||||
EditorListeners m_listeners;
|
||||
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user