Skip to content

Commit

Permalink
[BugFix:TAGrading] Fix text annotation (#534)
Browse files Browse the repository at this point in the history
* Give text default text size

* minor fix

* undefined variable

* Update text.js

* Text input position attempt

* Text input box position

* Remove print statement
  • Loading branch information
Eceptonsu authored Jun 21, 2022
1 parent 905bc5d commit 2089efb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/UI/text.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import {

let _enabled = false;
let input;
let _textSize;
let _textColor;
let _textSize = localStorage.getItem(`text/size`) || 12;
let _textColor = localStorage.getItem(`text/color`) || '#000000';

/**
* Handle document.mouseup event
Expand All @@ -29,7 +29,7 @@ function handleDocumentMouseup(e) {
input.setAttribute('placeholder', 'Enter text... SHIFT + ENTER for new line');
input.style.border = `3px solid ${BORDER_COLOR}`;
input.style.borderRadius = '3px';
input.style.position = 'absolute';
input.style.position = 'fixed';
input.style.top = `${e.clientY}px`;
input.style.left = `${e.clientX}px`;
input.style.fontSize = `${_textSize}px`;
Expand Down
2 changes: 1 addition & 1 deletion web/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ render();
});

setText(
localStorage.getItem(`${RENDER_OPTIONS.documentId}/text/size`) || 10,
localStorage.getItem(`${RENDER_OPTIONS.documentId}/text/size`) || 12,
localStorage.getItem(`${RENDER_OPTIONS.documentId}/text/color`) || '#000000'
);

Expand Down

0 comments on commit 2089efb

Please sign in to comment.