Skip to content

Commit 2089efb

Browse files
authored
[BugFix:TAGrading] Fix text annotation (#534)
* Give text default text size * minor fix * undefined variable * Update text.js * Text input position attempt * Text input box position * Remove print statement
1 parent 905bc5d commit 2089efb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/UI/text.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import {
99

1010
let _enabled = false;
1111
let input;
12-
let _textSize;
13-
let _textColor;
12+
let _textSize = localStorage.getItem(`text/size`) || 12;
13+
let _textColor = localStorage.getItem(`text/color`) || '#000000';
1414

1515
/**
1616
* Handle document.mouseup event
@@ -29,7 +29,7 @@ function handleDocumentMouseup(e) {
2929
input.setAttribute('placeholder', 'Enter text... SHIFT + ENTER for new line');
3030
input.style.border = `3px solid ${BORDER_COLOR}`;
3131
input.style.borderRadius = '3px';
32-
input.style.position = 'absolute';
32+
input.style.position = 'fixed';
3333
input.style.top = `${e.clientY}px`;
3434
input.style.left = `${e.clientX}px`;
3535
input.style.fontSize = `${_textSize}px`;

web/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ render();
148148
});
149149

150150
setText(
151-
localStorage.getItem(`${RENDER_OPTIONS.documentId}/text/size`) || 10,
151+
localStorage.getItem(`${RENDER_OPTIONS.documentId}/text/size`) || 12,
152152
localStorage.getItem(`${RENDER_OPTIONS.documentId}/text/color`) || '#000000'
153153
);
154154

0 commit comments

Comments
 (0)