mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 19:45:12 +00:00
LibGfx: Fix draw_triangle() clipping calculations
This commit is contained in:
parent
e2f0e36bdb
commit
cbcf317e76
Notes:
sideshowbarker
2024-07-19 07:31:02 +09:00
Author: https://github.com/sunverwerth Commit: https://github.com/SerenityOS/serenity/commit/cbcf317e760 Pull-request: https://github.com/SerenityOS/serenity/pull/1840 Issue: https://github.com/SerenityOS/serenity/issues/1839
1 changed files with 4 additions and 4 deletions
|
@ -360,8 +360,8 @@ void Painter::draw_triangle(const Point& a, const Point& b, const Point& c, Colo
|
|||
|
||||
int top = p0.y();
|
||||
if (top < clip.top()) {
|
||||
x01 += dx01 * clip.top() - top;
|
||||
x02 += dx02 * clip.top() - top;
|
||||
x01 += dx01 * (clip.top() - top);
|
||||
x02 += dx02 * (clip.top() - top);
|
||||
top = clip.top();
|
||||
}
|
||||
|
||||
|
@ -381,8 +381,8 @@ void Painter::draw_triangle(const Point& a, const Point& b, const Point& c, Colo
|
|||
|
||||
top = p1.y();
|
||||
if (top < clip.top()) {
|
||||
x02 += dx02 * clip.top() - top;
|
||||
x12 += dx12 * clip.top() - top;
|
||||
x02 += dx02 * (clip.top() - top);
|
||||
x12 += dx12 * (clip.top() - top);
|
||||
top = clip.top();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue