1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 07:07:36 +00:00

LibGfx/TinyVG: Parse and ignore line_width in paths

TinyVG allows varying the line width along a path, this is not supported
in LibGfx so we just ignore this (but still need to parse the field).
This commit is contained in:
MacDue 2023-07-14 21:31:42 +01:00 committed by Andreas Kling
parent 8d940d57a4
commit bebfb81c85

View file

@ -247,6 +247,12 @@ public:
for (u32 i = 0; i < command_count; i++) {
u8 command_tag = TRY(m_stream.read_value<u8>());
auto path_command = static_cast<PathCommand>(command_tag & 0x7);
bool has_line_width = (command_tag >> 4) & 0b1;
if (has_line_width) {
// FIXME: TinyVG allows changing the line width within a path.
// This is not supported in LibGfx, so we currently ignore this.
(void)TRY(read_unit());
}
switch (path_command) {
case PathCommand::Line:
path.line_to(TRY(read_point()));