Skip to content
Snippets Groups Projects
Commit 2dbc23af authored by KDSBrowne's avatar KDSBrowne
Browse files

prevent text area going out of bounds on click creation

parent c17b8501
No related branches found
No related tags found
No related merge requests found
......@@ -2,8 +2,8 @@ import { check } from 'meteor/check';
const ANNOTATION_TYPE_TEXT = 'text';
const ANNOTATION_TYPE_PENCIL = 'pencil';
const DEFAULT_TEXT_WIDTH = 40;
const DEFAULT_TEXT_HEIGHT = 10;
const DEFAULT_TEXT_WIDTH = 30;
const DEFAULT_TEXT_HEIGHT = 20;
// line, triangle, ellipse, rectangle
function handleCommonAnnotation(meetingId, whiteboardId, userId, annotation) {
......@@ -47,6 +47,13 @@ function handleTextUpdate(meetingId, whiteboardId, userId, annotation) {
if (useDefaultSize) {
annotationInfo.textBoxWidth = DEFAULT_TEXT_WIDTH;
annotationInfo.textBoxHeight = DEFAULT_TEXT_HEIGHT;
if (100 - annotationInfo.x < DEFAULT_TEXT_WIDTH) {
annotationInfo.textBoxWidth = 100 - annotationInfo.x;
}
if (100 - annotationInfo.y < DEFAULT_TEXT_HEIGHT) {
annotationInfo.textBoxHeight = 100 - annotationInfo.y;
}
}
const selector = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment