mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 10:20:48 +00:00
Improve Graphics::dirty() to avoid flipping unnecessary she::Display areas
This commit is contained in:
parent
f07359d71c
commit
73605749e6
@ -464,6 +464,14 @@ gfx::Size Graphics::doUIStringAlgorithm(const std::string& str, gfx::Color fg, g
|
||||
return calculatedSize;
|
||||
}
|
||||
|
||||
void Graphics::dirty(const gfx::Rect& bounds)
|
||||
{
|
||||
gfx::Rect rc = m_surface->getClipBounds();
|
||||
rc = rc.createIntersection(bounds);
|
||||
if (!rc.isEmpty())
|
||||
m_dirtyBounds |= rc;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// ScreenGraphics
|
||||
|
||||
|
@ -101,10 +101,7 @@ namespace ui {
|
||||
|
||||
private:
|
||||
gfx::Size doUIStringAlgorithm(const std::string& str, gfx::Color fg, gfx::Color bg, const gfx::Rect& rc, int align, bool draw);
|
||||
|
||||
void dirty(const gfx::Rect& bounds) {
|
||||
m_dirtyBounds |= bounds;
|
||||
}
|
||||
void dirty(const gfx::Rect& bounds);
|
||||
|
||||
she::Surface* m_surface;
|
||||
int m_dx;
|
||||
|
Loading…
x
Reference in New Issue
Block a user