mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibDraw: Painter::draw_pixel() with thickness>1 was doubly translating
Callers of draw_pixel() are not expecting it to apply translation since they will have already done that themselves. This was causing draw_line() with thickness>1 to have an offset applied in case the painter was already translated.
This commit is contained in:
parent
e2b88f66d3
commit
f04394b9f3
Notes:
sideshowbarker
2024-07-19 11:01:39 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/f04394b9f36
1 changed files with 1 additions and 1 deletions
|
@ -770,7 +770,7 @@ void Painter::draw_pixel(const Point& position, Color color, int thickness)
|
|||
if (thickness == 1)
|
||||
return set_pixel_with_draw_op(m_target->scanline(position.y())[position.x()], color);
|
||||
Rect rect { position.translated(-(thickness / 2), -(thickness / 2)), { thickness, thickness } };
|
||||
fill_rect(rect, color);
|
||||
fill_rect(rect.translated(-state().translation), color);
|
||||
}
|
||||
|
||||
void Painter::draw_line(const Point& p1, const Point& p2, Color color, int thickness, bool dotted)
|
||||
|
|
Loading…
Reference in a new issue