From 774b62df875f3e9f160c275ec23698c5c0e31a8a Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Tue, 16 Aug 2022 15:14:27 +0200 Subject: [PATCH] tests: SvgAnalyzer: GraphvizNode: add retrieval of bounding box --- tests/graphviz_node.cpp | 2 ++ tests/graphviz_node.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/tests/graphviz_node.cpp b/tests/graphviz_node.cpp index b1857c041..a7ca9fd58 100644 --- a/tests/graphviz_node.cpp +++ b/tests/graphviz_node.cpp @@ -5,6 +5,8 @@ GraphvizNode::GraphvizNode(SVG::SVGElement &svg_element) std::string_view GraphvizNode::node_id() const { return m_node_id; } +SVG::SVGRect GraphvizNode::bbox() const { return m_svg_g_element.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 2de2c6c0c..2bfc8e2ad 100644 --- a/tests/graphviz_node.h +++ b/tests/graphviz_node.h @@ -15,6 +15,8 @@ public: GraphvizNode() = delete; explicit GraphvizNode(SVG::SVGElement &svg_element); + /// Return the node's bounding box + SVG::SVGRect bbox() const; /// Return the node's `node_id` as defined by the DOT language std::string_view node_id() const; /// Return a non-mutable reference to the SVG `g` element corresponding to the -- 2.40.0