From 0654f076ce0f24b170094697b10f33cca16cba49 Mon Sep 17 00:00:00 2001 From: James Stout Date: Mon, 1 Jan 2024 05:57:02 +0000 Subject: [PATCH] Fix polytomy bounding box calculation. Caused numerical instability when zooming deep (e.g. Citrus reticulata) due to bad choice of graphref. --- .../src/projection/horizon_calc/polytomy_horizon_calc.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/OZprivate/rawJS/OZTreeModule/src/projection/horizon_calc/polytomy_horizon_calc.js b/OZprivate/rawJS/OZTreeModule/src/projection/horizon_calc/polytomy_horizon_calc.js index 4cd5d215..8278fd29 100755 --- a/OZprivate/rawJS/OZTreeModule/src/projection/horizon_calc/polytomy_horizon_calc.js +++ b/OZprivate/rawJS/OZTreeModule/src/projection/horizon_calc/polytomy_horizon_calc.js @@ -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]; } } } @@ -82,4 +81,4 @@ class PolytomyHorizonCalc { let polytomy_horizon_calc = new PolytomyHorizonCalc(); -export default polytomy_horizon_calc; \ No newline at end of file +export default polytomy_horizon_calc;