Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: Lint
on:
workflow_dispatch:
pull_request:
types:
- opened
- synchronize
push:
branches:
- main
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ All notable changes to this project will be documented here.

Nothing yet.

## [0.16.3] - Apr 25th, 2025
- Fix bug where the `Vanish` button wouldn't update its `locked` state when switching between subtasks.
- Fix bug where clicking the `Vanish` button would unexpectedly set the size cookie, causing future annotations in the same subtask to be loaded in a very small size on subsequent sessions, with the only way to recover being to increase the annotation size.

## [0.16.2] - Apr 2nd, 2025
- Fixed bug introduced in v0.15.0 where using the erase tool such that a polygon was separated into multiple disjoint regions would cause an unrecoverable error.

Expand Down
2 changes: 1 addition & 1 deletion dist/ulabel.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/ulabel.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ulabel",
"description": "An image annotation tool.",
"version": "0.16.2",
"version": "0.16.3",
"main": "dist/ulabel.js",
"module": "dist/ulabel.js",
"scripts": {
Expand Down
22 changes: 18 additions & 4 deletions src/toolbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ enum ValidResizeValues {
}

const toolboxDividerDiv = "<div class=toolbox-divider></div>";
const vanish_size = 0.01;

/** Chains the replaceAll method and the toLowerCase method.
* Optionally concatenates a string at the end of the method.
Expand Down Expand Up @@ -1328,7 +1329,6 @@ export class AnnotationResizeItem extends ToolboxItem {
const small_size = 1.5;
const large_size = 5;
const increment_size = 0.5;
const vanish_size = 0.01;
const subtask_cached_size = subtask.display_name.replaceLowerConcat(" ", "-", "-cached-size");
const subtask_vanished_flag = subtask.display_name.replaceLowerConcat(" ", "-", "-vanished");

Expand Down Expand Up @@ -1408,8 +1408,8 @@ export class AnnotationResizeItem extends ToolboxItem {
case "-":
// Check to make sure annotation line size won't go 0 or negative.
// If it would, set it equal to a small positive number
if (subtask.annotations.access[annotation_id].line_size - size <= 0.01) {
subtask.annotations.access[annotation_id].line_size = 0.01;
if (subtask.annotations.access[annotation_id].line_size - size <= vanish_size) {
subtask.annotations.access[annotation_id].line_size = vanish_size;
} else {
subtask.annotations.access[annotation_id].line_size -= size;
}
Expand All @@ -1420,7 +1420,10 @@ export class AnnotationResizeItem extends ToolboxItem {
}

if (subtask.annotations.ordering.length > 0) {
this.set_size_cookie(subtask.annotations.access[subtask.annotations.ordering[0]].line_size, subtask);
const line_size = subtask.annotations.access[subtask.annotations.ordering[0]].line_size;
if (line_size !== vanish_size) {
this.set_size_cookie(line_size, subtask);
}
}
}

Expand All @@ -1431,6 +1434,17 @@ export class AnnotationResizeItem extends ToolboxItem {
}
}

public redraw_update(ulabel: ULabel): void {
// Ensure the vanish button reflects the vanish state of the current subtask
const current_subtask = ulabel.get_current_subtask();
const subtask_vanished_flag = current_subtask.display_name.replaceLowerConcat(" ", "-", "-vanished");
if (this[subtask_vanished_flag]) {
$("#annotation-resize-v").addClass("locked");
} else {
$("#annotation-resize-v").removeClass("locked");
}
}

private set_size_cookie(cookie_value, subtask) {
const d = new Date();
d.setTime(d.getTime() + (10000 * 24 * 60 * 60 * 1000));
Expand Down
2 changes: 1 addition & 1 deletion src/version.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const ULABEL_VERSION = "0.16.2";
export const ULABEL_VERSION = "0.16.3";