m_svg_g_element.add_outline_overlap_bbox(node.svg_g_element(), tolerance);
}
-SVG::SVGElement &GraphvizEdge::arrow(const std::size_t index) const {
- return m_svg_g_element.find_child(SVG::SVGElementType::Polygon, index);
-}
-
static const std::unordered_set<std::string_view>
supported_primitive_arrow_shapes = {
"inv", //
fmt::format("primitive arrow shape {} is not yet supported",
primitive_arrow_shape)};
}
- auto edge_arrowhead = dir == "forward" ? arrow(0) : arrow(1);
+ 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();
return edge_arrowhead_bbox;
fmt::format("primitive arrow shape {} is not yet supported",
primitive_arrow_shape)};
}
- auto edge_arrowtail = arrow(0);
+ 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();
return edge_arrowtail_bbox;
/// both an arrowhead and an arrowtail, the arrowtail is at index 0 and the
/// arrowhead is at index 1. If there's only one, it's at index 0. Throws an
/// exception if there's no arrow at the specified index.
- SVG::SVGElement &arrow(std::size_t index = 0) const;
- /// Return the outline bounding box of the edge arrowhead. The outline
- /// bounding box is the bounding box with penwidth taken into account.
SVG::SVGRect
arrowhead_outline_bbox(std::string_view dir,
std::string_view primitive_arrow_shape) const;