From: Magnus Jacobsson Date: Tue, 23 Aug 2022 17:13:15 +0000 (+0200) Subject: tests: SVGAnalyzer: GraphvizEdge: add retrieval of outline bounding box X-Git-Tag: 6.0.1~7^2~2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=089de0d150fcc734b3baab9c4c96571d127dae64;p=graphviz tests: SVGAnalyzer: GraphvizEdge: add retrieval of outline bounding box This will be used in an upcoming commit that determines the overlap between the outline bounding box of a node and an edge. --- diff --git a/tests/graphviz_edge.cpp b/tests/graphviz_edge.cpp index 03c1a9aa7..f222e0b4d 100644 --- a/tests/graphviz_edge.cpp +++ b/tests/graphviz_edge.cpp @@ -41,3 +41,7 @@ double GraphvizEdge::penwidth() const { return m_svg_g_element.attribute_from_subtree( &SVG::SVGAttributes::stroke_width, &SVG::SVGElement::is_shape_element, 1); } + +SVG::SVGRect GraphvizEdge::outline_bbox() const { + return m_svg_g_element.outline_bbox(); +} diff --git a/tests/graphviz_edge.h b/tests/graphviz_edge.h index 743fca160..470f352a4 100644 --- a/tests/graphviz_edge.h +++ b/tests/graphviz_edge.h @@ -28,6 +28,9 @@ public: /// Return the edge's `fillcolor` attribute in RGB hex format if the opacity /// is 100 % or in RGBA hex format otherwise. std::string fillcolor() const; + /// 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's `penwidth` attribute double penwidth() const; /// Return a non-mutable reference to the SVG `g` element corresponding to the