From 09d08d581dea708e3d63e1a23a14c587ec8f538c Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Tue, 23 Aug 2022 19:12:47 +0200 Subject: [PATCH] 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. --- tests/graphviz_node.cpp | 4 ++++ tests/graphviz_node.h | 3 +++ 2 files changed, 7 insertions(+) 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 -- 2.40.0