From: Magnus Jacobsson Date: Tue, 4 Oct 2022 13:21:00 +0000 (+0200) Subject: tests: GraphvizEdge: handle primitive arrow shape 'box' in arrowhead_outline_bbox X-Git-Tag: 7.0.0~10^2~4 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5f296457ba9021a641c101b2087c7f2ba5678f99;p=graphviz tests: GraphvizEdge: handle primitive arrow shape 'box' in arrowhead_outline_bbox --- 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; }