From bebfb81c85dd2cf302f0381955bef2bda194f89c Mon Sep 17 00:00:00 2001 From: MacDue Date: Fri, 14 Jul 2023 21:31:42 +0100 Subject: [PATCH] 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). --- Userland/Libraries/LibGfx/ImageFormats/TinyVGLoader.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Userland/Libraries/LibGfx/ImageFormats/TinyVGLoader.cpp b/Userland/Libraries/LibGfx/ImageFormats/TinyVGLoader.cpp index 19f2bee52f..2035d7e1ff 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/TinyVGLoader.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/TinyVGLoader.cpp @@ -247,6 +247,12 @@ public: for (u32 i = 0; i < command_count; i++) { u8 command_tag = TRY(m_stream.read_value()); auto path_command = static_cast(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()));