]> granicus.if.org Git - graphviz/commitdiff
tests: SVGAnalyzer: GraphvizNode: add retrieval of outline bounding box
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Tue, 23 Aug 2022 17:12:47 +0000 (19:12 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Tue, 6 Sep 2022 19:30:03 +0000 (21:30 +0200)
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
tests/graphviz_node.h

index 630c34264ac723a38b687ef8a8297a5670a5777b..e563736b62c6870e8191455d2c7613afe8bd656a 100644 (file)
@@ -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;
 }
index dbe8b46ff482c63fa5772c8dcaddf532616a2957..097ce281ed210732caedef31b49401c8a9cef162 100644 (file)
@@ -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