overlap_in_rank_direction(overlap_bbox, rankdir);
// check maximum head node and edge overlap
- DO_CHECK(head_node_edge_overlap <=
- check_options.max_node_edge_overlap +
- check_options.svg_rounding_error * 2);
+ if (check_options.check_max_edge_node_overlap) {
+ DO_CHECK(head_node_edge_overlap <=
+ check_options.max_node_edge_overlap +
+ check_options.svg_rounding_error * 2);
+ }
}
// check tail node and edge overlap
overlap_in_rank_direction(overlap_bbox, rankdir);
// check maximum tail node and edge overlap
- DO_CHECK(tail_node_edge_overlap <=
- check_options.max_node_edge_overlap +
- check_options.svg_rounding_error * 2);
+ if (check_options.check_max_edge_node_overlap) {
+ DO_CHECK(tail_node_edge_overlap <=
+ check_options.max_node_edge_overlap +
+ check_options.svg_rounding_error * 2);
+ }
}
return success;
}
void test_edge_node_overlap(const graph_options &graph_options,
+ const tc_check_options &tc_check_options,
const write_options &write_options) {
const auto dot = generate_dot(graph_options);
std::pow(10, -graphviz_num_decimals_in_svg) / 2;
const check_options check_options = {
+ .check_max_edge_node_overlap =
+ tc_check_options.check_max_edge_node_overlap,
.max_node_edge_overlap = graphviz_bezier_clip_margin,
.svg_rounding_error = graphviz_max_svg_rounding_error,
};
#include "svg_analyzer.h"
+/// check options that can be controlled from the test case
+struct tc_check_options {
+ /// whether to check that there is not too much overlap
+ bool check_max_edge_node_overlap = true;
+};
+
struct check_options {
+ /// whether to check that there is not too much overlap
+ bool check_max_edge_node_overlap = true;
/// maximum allowed overlap between edge and node
double max_node_edge_overlap;
/// rounding error caused by limited precision in SVG attribute values
/// generate an SVG graph from the `dot` source and check that edges don't
/// overlap nodes
void test_edge_node_overlap(const graph_options &graph_options = {},
+ const tc_check_options &tc_check_options = {},
const write_options &write_options = {});