From f99c9dc11a932d302bd07f94370d7cb602076ee6 Mon Sep 17 00:00:00 2001 From: Rodrigo Tobar Date: Sun, 5 Feb 2023 13:59:48 +0800 Subject: [PATCH] LibGfx: Add the ability to append a Path into another This is useful in general (I'd imagine), but in particular having this will allow us to implement accented PDF Type1 Font glyphs, which consist of two separate glyphs that are composed into a single one. --- Userland/Libraries/LibGfx/Path.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Userland/Libraries/LibGfx/Path.h b/Userland/Libraries/LibGfx/Path.h index 2173749d18..e7934c4658 100644 --- a/Userland/Libraries/LibGfx/Path.h +++ b/Userland/Libraries/LibGfx/Path.h @@ -243,6 +243,14 @@ public: return m_bounding_box.value(); } + void append_path(Path const& path) + { + m_segments.ensure_capacity(m_segments.size() + path.m_segments.size()); + for (auto const& segment : path.m_segments) + m_segments.unchecked_append(segment); + invalidate_split_lines(); + } + Path copy_transformed(AffineTransform const&) const; DeprecatedString to_deprecated_string() const;