Skip to content

Commit

Permalink
Merge pull request #706 from wolfmanstout/bounding_box_fix
Browse files Browse the repository at this point in the history
Fix polytomy bounding box calculation.
  • Loading branch information
hyanwong authored Jan 12, 2025
2 parents 8a78ff6 + 0654f07 commit ec648db
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,13 @@ class PolytomyHorizonCalc {
return changed;
}
calc_horizon(node) {
// Calculate parent's arcr based on our own.
// Calculate parent's arcr within our coordinate reference.
function parent_arcr(node) {
if (!node.upnode) return 0;

// NB: node.upnode.arcr can't be relied on at this point, so derive from nextr
for (let i = 0; i < node.upnode.children.length; i++) {
if (node.upnode.children[i] === node) {
return node.arcr / node.upnode.nextr[i];
return node.upnode.arcr / node.upnode.nextr[i];
}
}
}
Expand Down Expand Up @@ -82,4 +81,4 @@ class PolytomyHorizonCalc {

let polytomy_horizon_calc = new PolytomyHorizonCalc();

export default polytomy_horizon_calc;
export default polytomy_horizon_calc;

0 comments on commit ec648db

Please sign in to comment.