1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:57:35 +00:00

Some work on window decorations.

This commit is contained in:
Andreas Kling 2018-10-11 23:14:51 +02:00
parent a4491e9630
commit a6e0577f30
4 changed files with 41 additions and 8 deletions

View file

@ -42,6 +42,24 @@ void Painter::fillRect(const Rect& rect, Color color)
}
}
void Painter::drawRect(const Rect& rect, Color color)
{
Rect r = rect;
r.moveBy(m_widget.x(), m_widget.y());
for (int y = r.top(); y < r.bottom(); ++y) {
dword* bits = scanline(y);
if (y == r.top() || y == (r.bottom() - 1)) {
for (int x = r.left(); x < r.right(); ++x) {
bits[x] = color.value();
}
} else {
bits[r.left()] = color.value();
bits[r.right() - 1] = color.value();
}
}
}
void Painter::drawText(const Rect& rect, const String& text, TextAlignment alignment, const Color& color)
{
Point point;