Skip to content

Commit

Permalink
call resetSelection when restoring an annotation that is not in image
Browse files Browse the repository at this point in the history
  • Loading branch information
timonegk committed Mar 31, 2021
1 parent 6b720a5 commit 65d5083
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -813,19 +813,21 @@ function calculateImageScale() {

tool.clear();
if ($('#keep_selection').prop('checked') && restoreAnnotation) {
let annotation_type = $('#annotation_type_id').children('[value=' + restoreAnnotation.annotation_type_id + ']').data();
let vector_type = annotation_type.vectorType;
let node_count = annotation_type.nodeCount;
tool.restoreSelection({
vector_type: vector_type,
node_count: node_count,
vector: restoreAnnotation.vector,
});
if (restoreAnnotation.vector === null) {
// not in image
tool.resetSelection();
$('#not_in_image').prop('checked', true);
$('#coordinate_table').hide();
setupCBCheckboxes();
} else {
let annotation_type = $('#annotation_type_id').children('[value=' + restoreAnnotation.annotation_type_id + ']').data();
let vector_type = annotation_type.vectorType;
let node_count = annotation_type.nodeCount;
tool.restoreSelection({
vector_type: vector_type,
node_count: node_count,
vector: restoreAnnotation.vector,
});
}
} else {
resetSelection();
Expand Down

0 comments on commit 65d5083

Please sign in to comment.