1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09:00

LibWeb: Abstract common operations of graphical SVG elements

This commit is contained in:
Matthew Olsson 2020-07-22 15:17:39 -07:00 committed by Andreas Kling
parent 3206263c2d
commit 943e4f8bf1
Notes: sideshowbarker 2024-07-19 04:36:54 +09:00
5 changed files with 83 additions and 7 deletions

View file

@ -154,10 +154,8 @@ void Path::segmentize_path()
float ymax = p0.y(), ymin = p1.y(), x_of_ymin = p1.x(), x_of_ymax = p0.x();
auto slope = p0.x() == p1.x() ? 0 : ((float)(p0.y() - p1.y())) / ((float)(p0.x() - p1.x()));
if (p0.y() < p1.y()) {
ymin = ymax;
ymax = p1.y();
x_of_ymax = x_of_ymin;
x_of_ymin = p0.x();
swap(ymin, ymax);
swap(x_of_ymin, x_of_ymax);
}
segments.append({ FloatPoint(p0.x(), p0.y()),