]> granicus.if.org Git - graphviz/commitdiff
tests: GraphvizEdge: handle primitive arrow shape 'tee' in arrowhead_outline_bbox
authorMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Thu, 6 Oct 2022 09:50:53 +0000 (11:50 +0200)
committerMagnus Jacobsson <Magnus.Jacobsson@berotec.se>
Fri, 4 Nov 2022 17:45:17 +0000 (18:45 +0100)
tests/graphviz_edge.cpp

index 99960a1a07cc7b28b438bb32f443ddce309c908b..9cc5b16dbd00fd48ce181d978e3b3fb65eae328c 100644 (file)
@@ -25,6 +25,7 @@ static const std::unordered_set<std::string_view>
         "dot",     //
         "inv",     //
         "normal",  //
+        "tee",     //
 };
 
 static const std::unordered_set<std::string_view>
@@ -33,6 +34,7 @@ static const std::unordered_set<std::string_view>
         "diamond", //
         "inv",     //
         "normal",  //
+        "tee",     //
 };
 
 static const std::unordered_set<std::string_view>
@@ -40,6 +42,12 @@ static const std::unordered_set<std::string_view>
         "dot", //
 };
 
+static const std::unordered_set<std::string_view>
+    primitive_arrow_shapes_containing_polyline = {
+        "box", //
+        "tee", //
+};
+
 static SVG::SVGElementType
 edge_arrowhead_main_svg_element_type(std::string_view primitive_arrow_shape) {
   if (polygon_based_primitive_arrow_shapes.contains(primitive_arrow_shape)) {
@@ -69,7 +77,8 @@ SVG::SVGRect GraphvizEdge::arrowhead_outline_bbox(
   auto edge_arrowhead =
       m_svg_g_element.find_child(main_svg_element_type, index);
   auto edge_arrowhead_bbox = edge_arrowhead.outline_bbox();
-  if (primitive_arrow_shape == "box") {
+  if (primitive_arrow_shapes_containing_polyline.contains(
+          primitive_arrow_shape)) {
     auto edge_arrowhead_stem =
         m_svg_g_element.find_child(SVG::SVGElementType::Polyline, index);
     auto edge_arrowhead_stem_bbox = edge_arrowhead_stem.outline_bbox();