mirror of https://github.com/aseprite/aseprite.git
Move dirty area from ToolLoop impl to ToolLoopManager
This commit is contained in:
parent
3e7bfbb296
commit
e960a79a87
|
|
@ -1,4 +1,5 @@
|
||||||
// Aseprite
|
// Aseprite
|
||||||
|
// Copyright (C) 2019 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2017 David Capello
|
// Copyright (C) 2001-2017 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
|
|
@ -221,12 +222,8 @@ namespace app {
|
||||||
// Returns true if the loop was canceled by the user
|
// Returns true if the loop was canceled by the user
|
||||||
virtual bool isCanceled() = 0;
|
virtual bool isCanceled() = 0;
|
||||||
|
|
||||||
// This region is modified by the ToolLoopManager so then you know
|
|
||||||
// what must be updated in updateDirtyArea().
|
|
||||||
virtual gfx::Region& getDirtyArea() = 0;
|
|
||||||
|
|
||||||
// Redraws the dirty area.
|
// Redraws the dirty area.
|
||||||
virtual void updateDirtyArea() = 0;
|
virtual void updateDirtyArea(const gfx::Region& dirtyArea) = 0;
|
||||||
|
|
||||||
virtual void updateStatusBar(const char* text) = 0;
|
virtual void updateStatusBar(const char* text) = 0;
|
||||||
virtual gfx::Point statusBarPositionOffset() = 0;
|
virtual gfx::Point statusBarPositionOffset() = 0;
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
// Aseprite
|
// Aseprite
|
||||||
|
// Copyright (C) 2019 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
|
|
@ -35,7 +36,6 @@ using namespace filters;
|
||||||
|
|
||||||
ToolLoopManager::ToolLoopManager(ToolLoop* toolLoop)
|
ToolLoopManager::ToolLoopManager(ToolLoop* toolLoop)
|
||||||
: m_toolLoop(toolLoop)
|
: m_toolLoop(toolLoop)
|
||||||
, m_dirtyArea(toolLoop->getDirtyArea())
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -206,7 +206,7 @@ void ToolLoopManager::doLoopStep(bool last_step)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_dirtyArea.isEmpty())
|
if (!m_dirtyArea.isEmpty())
|
||||||
m_toolLoop->updateDirtyArea();
|
m_toolLoop->updateDirtyArea(m_dirtyArea);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Applies the grid settings to the specified sprite point.
|
// Applies the grid settings to the specified sprite point.
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
// Aseprite
|
// Aseprite
|
||||||
|
// Copyright (C) 2019 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2017 David Capello
|
// Copyright (C) 2001-2017 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
|
|
@ -78,7 +79,7 @@ private:
|
||||||
Stroke m_stroke;
|
Stroke m_stroke;
|
||||||
Pointer m_lastPointer;
|
Pointer m_lastPointer;
|
||||||
gfx::Point m_oldPoint;
|
gfx::Point m_oldPoint;
|
||||||
gfx::Region& m_dirtyArea;
|
gfx::Region m_dirtyArea;
|
||||||
gfx::Region m_nextDirtyArea;
|
gfx::Region m_nextDirtyArea;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,6 @@ protected:
|
||||||
doc::color_t m_bgColor;
|
doc::color_t m_bgColor;
|
||||||
doc::color_t m_primaryColor;
|
doc::color_t m_primaryColor;
|
||||||
doc::color_t m_secondaryColor;
|
doc::color_t m_secondaryColor;
|
||||||
gfx::Region m_dirtyArea;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ToolLoopBase(Editor* editor,
|
ToolLoopBase(Editor* editor,
|
||||||
|
|
@ -261,11 +260,7 @@ public:
|
||||||
tools::Symmetry* getSymmetry() override { return m_symmetry.get(); }
|
tools::Symmetry* getSymmetry() override { return m_symmetry.get(); }
|
||||||
doc::Remap* getShadingRemap() override { return m_shadingRemap.get(); }
|
doc::Remap* getShadingRemap() override { return m_shadingRemap.get(); }
|
||||||
|
|
||||||
gfx::Region& getDirtyArea() override {
|
void updateDirtyArea(const gfx::Region& dirtyArea) override {
|
||||||
return m_dirtyArea;
|
|
||||||
}
|
|
||||||
|
|
||||||
void updateDirtyArea() override {
|
|
||||||
// This is necessary here so the "on sprite crosshair" is hidden,
|
// This is necessary here so the "on sprite crosshair" is hidden,
|
||||||
// we update screen pixels with the new sprite, and then we show
|
// we update screen pixels with the new sprite, and then we show
|
||||||
// the crosshair saving the updated pixels. It fixes problems with
|
// the crosshair saving the updated pixels. It fixes problems with
|
||||||
|
|
@ -274,7 +269,7 @@ public:
|
||||||
HideBrushPreview hide(m_editor->brushPreview());
|
HideBrushPreview hide(m_editor->brushPreview());
|
||||||
|
|
||||||
m_document->notifySpritePixelsModified(
|
m_document->notifySpritePixelsModified(
|
||||||
m_sprite, m_dirtyArea, m_frame);
|
m_sprite, dirtyArea, m_frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
void updateStatusBar(const char* text) override {
|
void updateStatusBar(const char* text) override {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue