From: Magnus Jacobsson Date: Tue, 23 Aug 2022 17:12:47 +0000 (+0200) Subject: tests: SVGAnalyzer: GraphvizNode: add retrieval of outline bounding box X-Git-Tag: 6.0.1~7^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=09d08d581dea708e3d63e1a23a14c587ec8f538c;p=graphviz tests: SVGAnalyzer: GraphvizNode: 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_node.cpp b/tests/graphviz_node.cpp index 630c34264..e563736b6 100644 --- a/tests/graphviz_node.cpp +++ b/tests/graphviz_node.cpp @@ -34,6 +34,10 @@ std::string_view GraphvizNode::node_id() const { return m_node_id; } SVG::SVGRect GraphvizNode::bbox() const { return m_svg_g_element.bbox(); } +SVG::SVGRect GraphvizNode::outline_bbox() const { + return m_svg_g_element.outline_bbox(); +} + const SVG::SVGElement &GraphvizNode::svg_g_element() const { return m_svg_g_element; } diff --git a/tests/graphviz_node.h b/tests/graphviz_node.h index dbe8b46ff..097ce281e 100644 --- a/tests/graphviz_node.h +++ b/tests/graphviz_node.h @@ -27,6 +27,9 @@ public: std::string fillcolor() const; /// Return the node's `node_id` as defined by the DOT language std::string_view node_id() const; + /// Return the outline bounding box of the node. The outline bounding box is + /// the bounding box with penwidth taken into account. + SVG::SVGRect outline_bbox() const; /// Return the node's `penwidth` attribute double penwidth() const; /// Return a non-mutable reference to the SVG `g` element corresponding to the