1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 08:47:44 +00:00

Very hacky support for dragging a window around.

This commit is contained in:
Andreas Kling 2018-10-12 02:24:05 +02:00
parent 22721e6729
commit 64127e0637
7 changed files with 80 additions and 14 deletions

View file

@ -54,6 +54,25 @@ void Painter::drawRect(const Rect& rect, Color color)
}
}
void Painter::xorRect(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;