From: Magnus Jacobsson Date: Thu, 6 Oct 2022 09:50:53 +0000 (+0200) Subject: tests: GraphvizEdge: handle primitive arrow shape 'tee' in arrowhead_outline_bbox X-Git-Tag: 7.0.1~3^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0e4fd87974940c70af78fc474e26060dbd0c5704;p=graphviz tests: GraphvizEdge: handle primitive arrow shape 'tee' in arrowhead_outline_bbox --- diff --git a/tests/graphviz_edge.cpp b/tests/graphviz_edge.cpp index 99960a1a0..9cc5b16db 100644 --- a/tests/graphviz_edge.cpp +++ b/tests/graphviz_edge.cpp @@ -25,6 +25,7 @@ static const std::unordered_set "dot", // "inv", // "normal", // + "tee", // }; static const std::unordered_set @@ -33,6 +34,7 @@ static const std::unordered_set "diamond", // "inv", // "normal", // + "tee", // }; static const std::unordered_set @@ -40,6 +42,12 @@ static const std::unordered_set "dot", // }; +static const std::unordered_set + 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();