mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-31 16:20:22 +00:00
Fix flicker issues on Windows moving the BrushPreview
This commit is contained in:
parent
58e27376bd
commit
be74710067
2
laf
2
laf
@ -1 +1 @@
|
||||
Subproject commit 05592ba7b36b0eb22d50b4ae5c5b160a0794b05d
|
||||
Subproject commit 036c893e4ff2072b99b3f0ad434413d419d3ff0e
|
@ -1,5 +1,5 @@
|
||||
// Aseprite UI Library
|
||||
// Copyright (C) 2018 Igara Studio S.A.
|
||||
// Copyright (C) 2018-2019 Igara Studio S.A.
|
||||
// Copyright (C) 2001-2018 David Capello
|
||||
//
|
||||
// This file is released under the terms of the MIT license.
|
||||
@ -264,15 +264,13 @@ void Manager::flipDisplay()
|
||||
// Draw overlays.
|
||||
overlays->drawOverlays();
|
||||
|
||||
// Flip dirty region.
|
||||
{
|
||||
// Invalidate the dirty region in the laf::os::Display (the real OS window).
|
||||
m_dirtyRegion.createIntersection(
|
||||
m_dirtyRegion,
|
||||
gfx::Region(gfx::Rect(0, 0, ui::display_w(), ui::display_h())));
|
||||
|
||||
for (const auto& rc : m_dirtyRegion)
|
||||
m_display->flip(rc);
|
||||
|
||||
if (!m_dirtyRegion.isEmpty()) {
|
||||
m_display->invalidateRegion(m_dirtyRegion);
|
||||
m_dirtyRegion.clear();
|
||||
}
|
||||
}
|
||||
@ -1496,8 +1494,11 @@ bool Manager::sendMessageToWidget(Message* msg, Widget* widget)
|
||||
surface->fillRect(gfx::rgba(0, 0, 255), paintMsg->rect());
|
||||
}
|
||||
|
||||
if (m_display)
|
||||
m_display->flip(gfx::Rect(0, 0, display_w(), display_h()));
|
||||
if (m_display) {
|
||||
m_display->invalidateRegion(
|
||||
gfx::Region(gfx::Rect(0, 0, display_w(), display_h())));
|
||||
// TODO m_display->update() ??
|
||||
}
|
||||
|
||||
base::this_thread::sleep_for(0.002);
|
||||
#endif
|
||||
|
@ -340,7 +340,8 @@ void View::onSetViewScroll(const gfx::Point& pt)
|
||||
{
|
||||
auto display = manager->getDisplay();
|
||||
if (display)
|
||||
display->flip(gfx::Rect(0, 0, display_w(), display_h()));
|
||||
display->invalidateRegion(
|
||||
gfx::Region(gfx::Rect(0, 0, display_w(), display_h())));
|
||||
base::this_thread::sleep_for(0.002);
|
||||
{
|
||||
os::Surface* surface = display->getSurface();
|
||||
@ -349,7 +350,8 @@ void View::onSetViewScroll(const gfx::Point& pt)
|
||||
surface->fillRect(gfx::rgba(255, 0, 0), rc);
|
||||
}
|
||||
if (display)
|
||||
display->flip(gfx::Rect(0, 0, display_w(), display_h()));
|
||||
display->invalidateRegion(
|
||||
gfx::Region(gfx::Rect(0, 0, display_w(), display_h())));
|
||||
base::this_thread::sleep_for(0.002);
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user