mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-10 03:44:16 +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;
|
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
|
// ScreenGraphics
|
||||||
|
|
||||||
|
@ -101,10 +101,7 @@ namespace ui {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
gfx::Size doUIStringAlgorithm(const std::string& str, gfx::Color fg, gfx::Color bg, const gfx::Rect& rc, int align, bool draw);
|
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);
|
||||||
void dirty(const gfx::Rect& bounds) {
|
|
||||||
m_dirtyBounds |= bounds;
|
|
||||||
}
|
|
||||||
|
|
||||||
she::Surface* m_surface;
|
she::Surface* m_surface;
|
||||||
int m_dx;
|
int m_dx;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user