From 8f2e0df6eebe9c364ce32505bc7f28382da8443c Mon Sep 17 00:00:00 2001 From: Jordi Date: Tue, 20 Feb 2024 17:26:18 +0100 Subject: [PATCH] Fix bug when drawing the aligned panel. Before this change, when moving the aligned panel you would get an error saying: AttributeError: 'NoneType' object has no attribute 'x' --- ete4/smartview/gui/static/js/draw.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ete4/smartview/gui/static/js/draw.js b/ete4/smartview/gui/static/js/draw.js index e05bf90a..cb587cac 100644 --- a/ete4/smartview/gui/static/js/draw.js +++ b/ete4/smartview/gui/static/js/draw.js @@ -23,7 +23,7 @@ async function update() { update_minimap_visible_rect(); } -async function get_tree_params() { +function get_tree_params() { const [zx, zy, za] = [view.zoom.x, view.zoom.y, view.zoom.a]; const [x, y] = [view.tl.x, view.tl.y]; const [w, h] = [div_tree.offsetWidth / zx, div_tree.offsetHeight / zy]; @@ -52,7 +52,7 @@ var align_drawing = false; async function draw_tree() { div_tree.style.cursor = "wait"; - const params = await get_tree_params(); + const params = get_tree_params(); // Fix the tree if it has zero width. if (params.w <= 0) {