ソースを参照

LibWeb: Clear the path of a SVGPathElement if the attribute changes

Otherwise, modifying the `d` attribute would not cause any visual
changes to the path.
Sam Atkins 3 年 前
コミット
9dcc752bcf
1 ファイル変更4 行追加2 行削除
  1. 4 2
      Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp

+ 4 - 2
Userland/Libraries/LibWeb/SVG/SVGPathElement.cpp

@@ -88,12 +88,14 @@ SVGPathElement::SVGPathElement(DOM::Document& document, QualifiedName qualified_
 {
 }
 
-void SVGPathElement::parse_attribute(const FlyString& name, const String& value)
+void SVGPathElement::parse_attribute(FlyString const& name, String const& value)
 {
     SVGGeometryElement::parse_attribute(name, value);
 
-    if (name == "d")
+    if (name == "d") {
         m_instructions = AttributeParser::parse_path_data(value);
+        m_path.clear();
+    }
 }
 
 Gfx::Path& SVGPathElement::get_path()