Documentation pass

This commit is contained in:
2022-06-09 12:20:35 -05:00
parent d362058b20
commit 80688d7a16
4 changed files with 215 additions and 28 deletions

View File

@@ -176,9 +176,7 @@ impl BoardBuilderApp {
for edge in &node.edges {
let other_node = &board.nodes[edge];
if board.config.horizontal_wrapping && node.should_wrap_horizontal(other_node) {
let mut nodes = [node, other_node];
nodes.sort_by(|a, b| a.x.partial_cmp(&b.x).unwrap());
let [left_node, right_node] = nodes;
let [left_node, right_node] = node.horizontal_order(other_node);
let y_mid = left_node.y_mid(right_node);
painter.line_segment(
[view.inv_xform(0.0, y_mid), view.inv_xform(left_node.x, left_node.y)],
@@ -248,11 +246,7 @@ impl CreateNodeDialog {
self.open = true;
self.board = board;
self.node = Node {
x,
y,
..Node::default()
}
self.node = Node::new(x, y);
}
fn ui(&mut self, ctx: &Context) {