Ver Fonte

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.
Rodrigo Tobar há 2 anos atrás
pai
commit
f99c9dc11a
1 ficheiros alterados com 8 adições e 0 exclusões
  1. 8 0
      Userland/Libraries/LibGfx/Path.h

+ 8 - 0
Userland/Libraries/LibGfx/Path.h

@@ -243,6 +243,14 @@ public:
         return m_bounding_box.value();
         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;
     Path copy_transformed(AffineTransform const&) const;
 
 
     DeprecatedString to_deprecated_string() const;
     DeprecatedString to_deprecated_string() const;