Skip to content

Commit

Permalink
fix: LEAP-433: Fix cursor disappearence issue in labeling interface (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
juliosgarbi committed Apr 19, 2024
1 parent c7ac851 commit 4fa8465
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 18 deletions.
8 changes: 4 additions & 4 deletions web/dist/apps/labelstudio/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"message": "Merge branch 'develop' into 'fb-leap-999'",
"commit": "1ba075f63a03d43d82e117904cd75e5520ce24f2",
"date": "2024-04-19T14:16:56.000Z",
"branch": "fb-leap-999"
"message": "Merge branch 'develop' into 'fb-leap-433'",
"commit": "586ff57ef07af6b44783bd19ecab4c92e3c5f7e7",
"date": "2024-04-19T15:46:00.000Z",
"branch": "fb-leap-433"
}
8 changes: 4 additions & 4 deletions web/dist/libs/datamanager/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"message": "Merge branch 'develop' into 'fb-leap-999'",
"commit": "1ba075f63a03d43d82e117904cd75e5520ce24f2",
"date": "2024-04-19T14:16:56.000Z",
"branch": "fb-leap-999"
"message": "Merge branch 'develop' into 'fb-leap-433'",
"commit": "586ff57ef07af6b44783bd19ecab4c92e3c5f7e7",
"date": "2024-04-19T15:46:00.000Z",
"branch": "fb-leap-433"
}
2 changes: 1 addition & 1 deletion web/dist/libs/editor/main.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion web/dist/libs/editor/main.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions web/dist/libs/editor/version.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"message": "Merge branch 'develop' into 'fb-leap-999'",
"commit": "1ba075f63a03d43d82e117904cd75e5520ce24f2",
"date": "2024-04-19T14:16:56.000Z",
"branch": "fb-leap-999"
"message": "Merge branch 'develop' into 'fb-leap-433'",
"commit": "586ff57ef07af6b44783bd19ecab4c92e3c5f7e7",
"date": "2024-04-19T15:46:00.000Z",
"branch": "fb-leap-433"
}
20 changes: 16 additions & 4 deletions web/libs/editor/src/utils/canvas.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function exportRLE(region) {
// Prepare the canvas with sizes of image and stage
const canvas = document.createElement('canvas');

// We only care about physical size, so set canvas dimensions to
// We only care about physical size, so set canvas dimensions to
// image's natural dimensions
canvas.width = naturalWidth;
canvas.height = naturalHeight;
Expand Down Expand Up @@ -352,12 +352,24 @@ function Region2RLE(region) {
function brushSizeCircle(size) {
const canvas = document.createElement('canvas');
const ctx = canvas.getContext('2d');
const canvasPadding = 8;
const canvasOffset = 4;
const canvasSize = size * 4 + canvasPadding;
const circlePos = size / 2 + canvasOffset;
const circleRadius = size / 2;

canvas.width = size * 4 + 8;
canvas.height = size * 4 + 8;
canvas.width = canvasSize;
canvas.height = canvasSize;

ctx.beginPath();
ctx.arc(size / 2 + 4, size / 2 + 4, size / 2, 0, 2 * Math.PI, false);
ctx.arc(circlePos, circlePos, circleRadius, 0, 2 * Math.PI, false);

ctx.lineWidth = 3;
ctx.strokeStyle = 'black';
ctx.stroke();

ctx.beginPath();
ctx.arc(circlePos, circlePos, circleRadius, 0, 2 * Math.PI, false);

ctx.lineWidth = 2;
ctx.strokeStyle = 'white';
Expand Down

0 comments on commit 4fa8465

Please sign in to comment.