mirror of
https://github.com/aseprite/aseprite.git
synced 2024-10-03 21:46:20 +00:00
Add ui::Graphics::fillRegion()
This commit is contained in:
parent
9050861d78
commit
9b2f5399e9
@ -104,6 +104,12 @@ void Graphics::fillRect(ui::Color color, const gfx::Rect& rc)
|
||||
m_dy+rc.y+rc.h-1, to_system(color));
|
||||
}
|
||||
|
||||
void Graphics::fillRegion(ui::Color color, const gfx::Region& rgn)
|
||||
{
|
||||
for (gfx::Region::iterator it=rgn.begin(), end=rgn.end(); it!=end; ++it)
|
||||
fillRect(color, *it);
|
||||
}
|
||||
|
||||
void Graphics::drawBitmap(BITMAP* sprite, int x, int y)
|
||||
{
|
||||
draw_sprite(m_bmp, sprite, m_dx+x, m_dy+y);
|
||||
|
@ -18,6 +18,10 @@
|
||||
struct BITMAP;
|
||||
struct FONT;
|
||||
|
||||
namespace gfx {
|
||||
class Region;
|
||||
}
|
||||
|
||||
namespace ui {
|
||||
|
||||
// Class to render a widget in the screen.
|
||||
@ -37,6 +41,7 @@ namespace ui {
|
||||
|
||||
void drawRect(ui::Color color, const gfx::Rect& rc);
|
||||
void fillRect(ui::Color color, const gfx::Rect& rc);
|
||||
void fillRegion(ui::Color color, const gfx::Region& rgn);
|
||||
|
||||
void drawBitmap(BITMAP* sprite, int x, int y);
|
||||
void drawAlphaBitmap(BITMAP* sprite, int x, int y);
|
||||
|
Loading…
Reference in New Issue
Block a user