Skip to content

Commit 7fb3731

Browse files
committed
keep whitespace as typed
1 parent 9455891 commit 7fb3731

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/UI/text.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function handleDocumentMouseup(e) {
3333
input.style.top = `${e.clientY}px`;
3434
input.style.left = `${e.clientX}px`;
3535
input.style.fontSize = `${_textSize}px`;
36-
input.style.zIndex = "41";
36+
input.style.zIndex = '41';
3737
input.addEventListener('blur', handleInputBlur);
3838
input.addEventListener('keyup', handleInputKeyup);
3939

@@ -85,7 +85,7 @@ function saveText() {
8585
type: 'textbox',
8686
size: _textSize * scale,
8787
color: _textColor,
88-
content: input.value,
88+
content: value,
8989
x: pt[0],
9090
y: pt[1],
9191
rotation: -viewport.rotation

src/render/renderText.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ export default function renderText(a) {
1818
y: a.y,
1919
fill: normalizeColor(a.color || '#000'),
2020
fontSize: a.size,
21-
transform: `rotate(${a.rotation})`
21+
transform: `rotate(${a.rotation})`,
22+
style: 'white-space: pre'
2223
});
2324
text.innerHTML = a.content;
2425

0 commit comments

Comments
 (0)