mirror of
https://github.com/aseprite/aseprite.git
synced 2024-11-20 14:21:45 +00:00
Fix bug in tools with TracePolicyLast: the old_dirty_area was accumulated between different ToolLoopManager loops
This commit is contained in:
parent
9b8e87da10
commit
f4d2b60948
@ -143,8 +143,6 @@ void ToolLoopManager::movement(const Pointer& pointer)
|
||||
|
||||
void ToolLoopManager::doLoopStep(bool last_step)
|
||||
{
|
||||
static Region old_dirty_area; // TODO Not thread safe
|
||||
|
||||
Points points_to_interwine;
|
||||
if (!last_step)
|
||||
m_toolLoop->getController()->getPointsToInterwine(m_points, points_to_interwine);
|
||||
@ -186,8 +184,9 @@ void ToolLoopManager::doLoopStep(bool last_step)
|
||||
calculateDirtyArea(m_toolLoop, points_to_interwine, dirty_area);
|
||||
|
||||
if (m_toolLoop->getTracePolicy() == TracePolicyLast) {
|
||||
dirty_area.createUnion(dirty_area, old_dirty_area);
|
||||
old_dirty_area = dirty_area;
|
||||
Region prev_dirty_area = dirty_area;
|
||||
dirty_area.createUnion(dirty_area, m_oldDirtyArea);
|
||||
m_oldDirtyArea = prev_dirty_area;
|
||||
}
|
||||
|
||||
if (!dirty_area.isEmpty())
|
||||
|
@ -22,6 +22,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "gfx/point.h"
|
||||
#include "gfx/region.h"
|
||||
|
||||
namespace gfx { class Region; }
|
||||
|
||||
@ -109,6 +110,7 @@ private:
|
||||
ToolLoop* m_toolLoop;
|
||||
Points m_points;
|
||||
gfx::Point m_oldPoint;
|
||||
gfx::Region m_oldDirtyArea;
|
||||
};
|
||||
|
||||
} // namespace tools
|
||||
|
Loading…
Reference in New Issue
Block a user