1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 09:47:35 +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

@ -193,6 +193,9 @@ void Gfx::AntiAliasingPainter::draw_circle(IntPoint center, int radius, Color co
Inline comments are from the paper.
*/
center *= m_underlying_painter.scale();
radius *= m_underlying_painter.scale();
// TODO: Generalize to ellipses (see paper)
// These happen to be the same here, but are treated separately in the paper:
@ -352,11 +355,11 @@ void Gfx::AntiAliasingPainter::fill_rect_with_rounded_corners(IntRect const& a_r
a_rect.x() + a_rect.width() - top_right_radius,
a_rect.y() + top_right_radius,
};
IntPoint bottom_right_corner {
IntPoint bottom_left_corner {
a_rect.x() + bottom_left_radius,
a_rect.y() + a_rect.height() - bottom_right_radius
};
IntPoint bottom_left_corner {
IntPoint bottom_right_corner {
a_rect.x() + a_rect.width() - bottom_left_radius,
a_rect.y() + a_rect.height() - bottom_left_radius
};