From: Magnus Jacobsson Date: Wed, 24 Aug 2022 09:49:12 +0000 (+0200) Subject: tests: SVGAnalyzer: add retrieval of edge stem to GraphvizEdge X-Git-Tag: 6.0.2~34^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c3aa6e9cf78440d1a3923aaf0f4d808957d1f516;p=graphviz tests: SVGAnalyzer: add retrieval of edge stem to GraphvizEdge --- diff --git a/tests/graphviz_edge.cpp b/tests/graphviz_edge.cpp index 4af31b658..26e3b4f82 100644 --- a/tests/graphviz_edge.cpp +++ b/tests/graphviz_edge.cpp @@ -30,6 +30,10 @@ std::string GraphvizEdge::fillcolor() const { return SVG::to_dot_color(fill, fill_opacity); } +SVG::SVGElement &GraphvizEdge::stem() const { + return m_svg_g_element.find_child(SVG::SVGElementType::Path); +} + const SVG::SVGElement &GraphvizEdge::svg_g_element() const { return m_svg_g_element; } diff --git a/tests/graphviz_edge.h b/tests/graphviz_edge.h index 7e4e23d15..bd6f8423f 100644 --- a/tests/graphviz_edge.h +++ b/tests/graphviz_edge.h @@ -44,6 +44,9 @@ public: /// Return the outline bounding box of the edge. The outline bounding box is /// the bounding box with penwidth taken into account. SVG::SVGRect outline_bbox() const; + /// Return the edge stem, i.e., the part of the edge that does not include any + /// arrowhead or arrowtail + SVG::SVGElement &stem() const; /// Return the edge's `penwidth` attribute double penwidth() const; /// Return a non-mutable reference to the SVG `g` element corresponding to the