Skip to content

Commit

Permalink
verification view: wait for image before drawing annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
timonegk committed Dec 9, 2020
1 parent cb318d4 commit 55585e0
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,13 @@ function calculateImageScale() {
if (tool) {
tool.clear();
}
// wait for image
let image = $('#image')[0];
if (!(image.complete && image.naturalHeight !== 0)) {
window.setTimeout(() => drawAnnotations(annotations, current), 50);
return;
}
// image is loaded
let annotation = annotations[0];
if (!tool || tool.annotationTypeId !== annotation.annotation_type.id ||
(tool.vector_type === 5 && tool.node_count !== annotation.annotation_type.node_count)) {
Expand Down

0 comments on commit 55585e0

Please sign in to comment.