1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:08:13 +00:00

LibWeb: Begin SVG element support

This commit starts adding a basic SVG element. Currently, svg elements
have support for the width and height properties, as well as the stroke,
stroke-width, and fill properties. The only child element supported
is the path element, as most other graphical elements are just shorthand
for paths.
This commit is contained in:
Matthew Olsson 2020-07-19 23:01:53 -07:00 committed by Andreas Kling
parent bbcdab2baa
commit 22f0953fe2
11 changed files with 1013 additions and 2 deletions

View file

@ -1412,7 +1412,7 @@ void Painter::fill_path(Path& path, Color color, WindingRule winding_rule)
});
#ifdef FILL_PATH_DEBUG
if ((int)scanline % 10 == 0) {
draw_text(Rect(active_list.last().x - 20, scanline, 20, 10), String::format("%d", (int)scanline));
draw_text(IntRect(active_list.last().x - 20, scanline, 20, 10), String::format("%d", (int)scanline));
}
#endif
@ -1499,7 +1499,7 @@ void Painter::fill_path(Path& path, Color color, WindingRule winding_rule)
#ifdef FILL_PATH_DEBUG
size_t i { 0 };
for (auto& segment : segments)
draw_line(Point(segment.from.x(), segment.from.y()), Point(segment.to.x(), segment.to.y()), Color::from_hsv(++i / segments.size() * 255, 255, 255), 1);
draw_line(IntPoint(segment.from.x(), segment.from.y()), IntPoint(segment.to.x(), segment.to.y()), Color::from_hsv(++i / segments.size() * 255, 255, 255), 1);
#endif
}