]> granicus.if.org Git - graphviz/commitdiff
tests: GraphvizEdge: handle primitive arrow shape 'box' in arrowtail_outline_bbox
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Tue, 4 Oct 2022 13:21:11 +0000 (15:21 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Fri, 14 Oct 2022 13:59:16 +0000 (15:59 +0200)
tests/graphviz_edge.cpp

index c65a13a3a897044579b3d7f127a0447c5046a784..35c75015fa6aaad307bbf684af6c4c55490d1aee 100644 (file)
@@ -61,7 +61,13 @@ SVG::SVGRect GraphvizEdge::arrowtail_outline_bbox(
   const auto index = 0;
   auto edge_arrowtail =
       m_svg_g_element.find_child(SVG::SVGElementType::Polygon, index);
-  const auto edge_arrowtail_bbox = edge_arrowtail.outline_bbox();
+  auto edge_arrowtail_bbox = edge_arrowtail.outline_bbox();
+  if (primitive_arrow_shape == "box") {
+    auto edge_arrowtail_stem =
+        m_svg_g_element.find_child(SVG::SVGElementType::Polyline, index);
+    auto edge_arrowtail_stem_bbox = edge_arrowtail_stem.outline_bbox();
+    edge_arrowtail_bbox.extend(edge_arrowtail_stem_bbox);
+  }
 
   return edge_arrowtail_bbox;
 }