1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 15:57:34 +00:00

LibGfx: Support scaling in AntiAliasingPainter::draw_circle()

Previously the painter would crash if scaling was enabled.
This commit is contained in:
MacDue 2022-03-19 00:29:22 +00:00 committed by Linus Groh
parent 6edea1d59f
commit 3c0e17f29f
3 changed files with 10 additions and 6 deletions

View file

@ -1713,11 +1713,11 @@ void Painter::draw_text(Function<void(IntRect const&, Utf8CodePointIterator&)> d
void Painter::set_pixel(IntPoint const& p, Color color, bool blend)
{
VERIFY(scale() == 1); // FIXME: Add scaling support.
auto point = p;
point.translate_by(state().translation);
if (!clip_rect().contains(point))
// Use the scale only to avoid clipping pixels set in drawing functions that handle
// scaling and call set_pixel() -- do not scale the pixel.
if (!clip_rect().contains(point / scale()))
return;
auto& dst = m_target->scanline(point.y())[point.x()];
if (!blend) {