Fix bug losing Document's extra cel when we paste and scroll with Space bar

This commit is contained in:
David Capello 2015-04-09 19:33:03 -03:00
parent a299826d7d
commit c25d9ac272
4 changed files with 9 additions and 12 deletions

View File

@ -1086,17 +1086,16 @@ void Editor::updateQuicktool()
// we change the quicktool. In this way we avoid using the
// quicktool brush size to clean the current tool cursor.
//
// TODO Remove EditorState::regenerateDrawingCursor() creating a
// new Document concept of multiple extra cels: we need an extra
// cel for the drawing cursor, other for the moving pixels,
// etc. In this way we'll not have conflicts between different
// uses of the same extra cel.
if (m_state->regenerateDrawingCursor())
// TODO Create a new Document concept of multiple extra cels: we
// need an extra cel for the drawing cursor, other for the moving
// pixels, etc. In this way we'll not have conflicts between
// different uses of the same extra cel.
if (m_state->requireBrushPreview())
hideDrawingCursor();
m_quicktool = new_quicktool;
if (m_state->regenerateDrawingCursor())
if (m_state->requireBrushPreview())
showDrawingCursor();
// If the tool has changed, we must to update the status bar because

View File

@ -107,10 +107,6 @@ namespace app {
// Returns true if this state accept the given quicktool.
virtual bool acceptQuickTool(tools::Tool* tool) { return true; }
// Returns true if this state supports changing the drawing cursor
// extra cel.
virtual bool regenerateDrawingCursor() { return true; }
private:
DISABLE_COPYING(EditorState);
};

View File

@ -27,6 +27,8 @@ namespace app {
virtual bool onMouseMove(Editor* editor, ui::MouseMessage* msg) override;
virtual bool onUpdateStatusBar(Editor* editor) override;
virtual bool requireBrushPreview() override { return false; }
private:
Cel* m_cel;
gfx::Point m_celStart;

View File

@ -48,7 +48,7 @@ namespace app {
virtual bool onKeyUp(Editor* editor, ui::KeyMessage* msg) override;
virtual bool onUpdateStatusBar(Editor* editor) override;
virtual bool acceptQuickTool(tools::Tool* tool) override;
virtual bool regenerateDrawingCursor() override { return false; }
virtual bool requireBrushPreview() override { return false; }
// EditorObserver
virtual void onBeforeFrameChanged(Editor* editor) override;