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:
parent
6edea1d59f
commit
3c0e17f29f
3 changed files with 10 additions and 6 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue