mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 06:32:42 +00:00
Fix graphical glitches while painting (fix #1262)
This commit is contained in:
parent
1ffbd4c343
commit
d4c4cb5f72
@ -52,10 +52,6 @@ DrawingState::~DrawingState()
|
||||
|
||||
void DrawingState::initToolLoop(Editor* editor, MouseMessage* msg)
|
||||
{
|
||||
// It's needed to clear and redraw the brush boundaries after the
|
||||
// first mouse pressed/point shape if drawn.
|
||||
HideBrushPreview hide(editor->brushPreview());
|
||||
|
||||
// Prepare preview image (the destination image will be our preview
|
||||
// in the tool-loop time, so we can see what we are drawing)
|
||||
editor->renderEngine().setPreviewImage(
|
||||
|
@ -305,6 +305,12 @@ bool StandbyState::onMouseDown(Editor* editor, MouseMessage* msg)
|
||||
if (layerEdges)
|
||||
layerEdgesOption(false);
|
||||
|
||||
// We need to clear and redraw the brush boundaries after the
|
||||
// first mouse pressed/point shape if drawn. This is to avoid
|
||||
// graphical glitches (invalid areas in the ToolLoop's src/dst
|
||||
// images).
|
||||
HideBrushPreview hide(editor->brushPreview());
|
||||
|
||||
tools::ToolLoop* toolLoop = create_tool_loop(editor, context);
|
||||
if (toolLoop) {
|
||||
EditorStatePtr newState(new DrawingState(toolLoop));
|
||||
|
@ -242,10 +242,8 @@ public:
|
||||
}
|
||||
|
||||
void updateDirtyArea() override {
|
||||
// TODO find a way to avoid calling hide/show brush preview here
|
||||
HideBrushPreview hide(m_editor->brushPreview());
|
||||
m_document->notifySpritePixelsModified(m_sprite, m_dirtyArea,
|
||||
m_frame);
|
||||
m_document->notifySpritePixelsModified(
|
||||
m_sprite, m_dirtyArea, m_frame);
|
||||
}
|
||||
|
||||
void updateStatusBar(const char* text) override {
|
||||
|
Loading…
x
Reference in New Issue
Block a user