use super::*;
pub(in crate::svg::parity::flowchart) fn maybe_collapse_degenerate_subgraph_edge_route(
ctx: &FlowchartRenderCtx<'_>,
edge: &crate::flowchart::FlowEdge,
data_points: &[crate::model::LayoutPoint],
line_data: &mut Vec<crate::model::LayoutPoint>,
) {
let edge_is_between_subgraph_and_descendant = (ctx
.subgraphs_by_id
.contains_key(edge.from.as_str())
&& flowchart_is_strict_descendant(&ctx.parent, edge.to.as_str(), edge.from.as_str()))
|| (ctx.subgraphs_by_id.contains_key(edge.to.as_str())
&& flowchart_is_strict_descendant(&ctx.parent, edge.from.as_str(), edge.to.as_str()));
if !edge_is_between_subgraph_and_descendant {
return;
}
let Some(p) = data_points.last() else {
return;
};
line_data.clear();
line_data.push(crate::model::LayoutPoint {
x: p.x + 4.0,
y: p.y,
});
}