Skip to content

Commit

Permalink
Fix bug when drawing the aligned panel.
Browse files Browse the repository at this point in the history
Before this change, when moving the aligned panel you would get
an error saying:

  AttributeError: 'NoneType' object has no attribute 'x'
  • Loading branch information
jordibc committed Feb 20, 2024
1 parent 216e54d commit 8f2e0df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ete4/smartview/gui/static/js/draw.js
Expand Up @@ -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];
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 8f2e0df

Please sign in to comment.