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:
parent
3206263c2d
commit
943e4f8bf1
Notes:
sideshowbarker
2024-07-19 04:36:54 +09:00
Author: https://github.com/mattco98
Commit: 943e4f8bf1
Pull-request: https://github.com/SerenityOS/serenity/pull/2861
5 changed files with 83 additions and 7 deletions
|
@ -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()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue