Finally fixed bugs -- please test your code before pushing

bad hpp
This commit is contained in:
hppeng 2022-06-23 07:53:55 -07:00
parent b5f05cb1e6
commit c42e96d360

View file

@ -68,17 +68,19 @@ function construct_AT(elem, tree) {
// connect corners // connect corners
let connector = connect_elem.cloneNode() if (parent_node.display.row != node.display.row && parent_node.display.col != node.display.col) {
connector.style.backgroundImage = "url('../media/atree/connect_angle.png')"; let connector = connect_elem.cloneNode()
connector.id = "r" + parent_node.display.row + "-c" + node.display.col + "-angle" connector.style.backgroundImage = "url('../media/atree/connect_angle.png')";
document.getElementById("atree-row-" + parent_node.display.row).children[node.display.col].appendChild(connector); connector.id = "r" + parent_node.display.row + "-c" + node.display.col + "-angle"
if (parent_node.display.col > node.display.col && (parent_node.display.row != node.display.row)) { document.getElementById("atree-row-" + parent_node.display.row).children[node.display.col].appendChild(connector);
connector.classList.add("rotate-180"); if (parent_node.display.col > node.display.col) {
connector.classList.add("rotate-180");
}
else {// if (parent_node.display.col < node.display.col && (parent_node.display.row != node.display.row)) {
connector.classList.add("rotate-270");
}
resolve_connector(document.getElementById("atree-row-" + parent_node.display.row).children[node.display.col]);
} }
else if (parent_node.display.col < node.display.col && (parent_node.display.row != node.display.row)) {
connector.classList.add("rotate-270");
}
resolve_connector(document.getElementById("atree-row-" + parent_node.display.row).children[node.display.col]);
} }
// create node // create node