fix: add an offset of 0.5px for text editor in containers (#6328)

* fix: add an offset of 0.5px for text editor in containers

* fix specs and lint
This commit is contained in:
Aakansha Doshi 2023-03-09 13:07:36 +05:30 committed by GitHub
parent 8542c95a7a
commit dd4c333925
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -11,7 +11,7 @@ import {
isBoundToContainer,
isTextElement,
} from "./typeChecks";
import { CLASSES, isFirefox, isSafari, VERTICAL_ALIGN } from "../constants";
import { CLASSES, VERTICAL_ALIGN } from "../constants";
import {
ExcalidrawElement,
ExcalidrawLinearElement,
@ -273,8 +273,7 @@ export const textWysiwyg = ({
if (!container) {
maxWidth = (appState.width - 8 - viewportX) / appState.zoom.value;
textElementWidth = Math.min(textElementWidth, maxWidth);
} else if (isFirefox || isSafari) {
// As firefox, Safari needs little higher dimensions on DOM
} else {
textElementWidth += 0.5;
}
// Make sure text editor height doesn't go beyond viewport