From 5f296457ba9021a641c101b2087c7f2ba5678f99 Mon Sep 17 00:00:00 2001 From: Magnus Jacobsson Date: Tue, 4 Oct 2022 15:21:00 +0200 Subject: [PATCH] tests: GraphvizEdge: handle primitive arrow shape 'box' in arrowhead_outline_bbox --- tests/graphviz_edge.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/tests/graphviz_edge.cpp b/tests/graphviz_edge.cpp index 8db2301b6..c65a13a3a 100644 --- a/tests/graphviz_edge.cpp +++ b/tests/graphviz_edge.cpp @@ -20,6 +20,7 @@ void GraphvizEdge::add_outline_overlap_bbox(const GraphvizNode &node, static const std::unordered_set supported_primitive_arrow_shapes = { + "box", // "inv", // "normal", // }; @@ -37,7 +38,13 @@ SVG::SVGRect GraphvizEdge::arrowhead_outline_bbox( const auto index = dir == "forward" ? 0 : 1; auto edge_arrowhead = m_svg_g_element.find_child(SVG::SVGElementType::Polygon, index); - const auto edge_arrowhead_bbox = edge_arrowhead.outline_bbox(); + auto edge_arrowhead_bbox = edge_arrowhead.outline_bbox(); + if (primitive_arrow_shape == "box") { + auto edge_arrowhead_stem = + m_svg_g_element.find_child(SVG::SVGElementType::Polyline, index); + auto edge_arrowhead_stem_bbox = edge_arrowhead_stem.outline_bbox(); + edge_arrowhead_bbox.extend(edge_arrowhead_stem_bbox); + } return edge_arrowhead_bbox; } -- 2.40.0