]> granicus.if.org Git - graphviz/commitdiff
tests: SVGAnalyzer: GraphvizEdge: add retrieval of outline bounding box
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Tue, 23 Aug 2022 17:13:15 +0000 (19:13 +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_edge.cpp
tests/graphviz_edge.h

index 03c1a9aa72ada1879314d8cc54efc3fc5af8c784..f222e0b4df442daf68a6e68b7bc5261d63218ea0 100644 (file)
@@ -41,3 +41,7 @@ double GraphvizEdge::penwidth() const {
   return m_svg_g_element.attribute_from_subtree<double>(
       &SVG::SVGAttributes::stroke_width, &SVG::SVGElement::is_shape_element, 1);
 }
+
+SVG::SVGRect GraphvizEdge::outline_bbox() const {
+  return m_svg_g_element.outline_bbox();
+}
index 743fca1608d51e4bd9e13f9e35e845671335b6d6..470f352a40bf1b7c21b7c4ecf76fbc6f1d9eddb7 100644 (file)
@@ -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