js-draw 0.7.0 → 0.7.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/dist/bundle.js +1 -1
- package/dist/src/tools/TextTool.js +3 -0
- package/package.json +1 -1
- package/src/tools/TextTool.ts +4 -0
@@ -39,6 +39,7 @@ export default class TextTool extends BaseTool {
|
|
39
39
|
background-color: rgba(0, 0, 0, 0);
|
40
40
|
|
41
41
|
white-space: pre;
|
42
|
+
overflow: hidden;
|
42
43
|
|
43
44
|
padding: 0;
|
44
45
|
margin: 0;
|
@@ -122,6 +123,8 @@ export default class TextTool extends BaseTool {
|
|
122
123
|
this.textRotation = -this.editor.viewport.getRotationAngle();
|
123
124
|
this.textScale = Vec2.of(1, 1).times(this.editor.viewport.getSizeOfPixelOnCanvas());
|
124
125
|
this.updateTextInput();
|
126
|
+
// Update the input size/position/etc. after the placeHolder has had time to appear.
|
127
|
+
setTimeout(() => this.updateTextInput(), 0);
|
125
128
|
this.textInputElem.oninput = () => {
|
126
129
|
if (this.textInputElem) {
|
127
130
|
this.textInputElem.style.width = `${this.textInputElem.scrollWidth}px`;
|
package/package.json
CHANGED
package/src/tools/TextTool.ts
CHANGED
@@ -47,6 +47,7 @@ export default class TextTool extends BaseTool {
|
|
47
47
|
background-color: rgba(0, 0, 0, 0);
|
48
48
|
|
49
49
|
white-space: pre;
|
50
|
+
overflow: hidden;
|
50
51
|
|
51
52
|
padding: 0;
|
52
53
|
margin: 0;
|
@@ -152,6 +153,9 @@ export default class TextTool extends BaseTool {
|
|
152
153
|
this.textScale = Vec2.of(1, 1).times(this.editor.viewport.getSizeOfPixelOnCanvas());
|
153
154
|
this.updateTextInput();
|
154
155
|
|
156
|
+
// Update the input size/position/etc. after the placeHolder has had time to appear.
|
157
|
+
setTimeout(() => this.updateTextInput(), 0);
|
158
|
+
|
155
159
|
this.textInputElem.oninput = () => {
|
156
160
|
if (this.textInputElem) {
|
157
161
|
this.textInputElem.style.width = `${this.textInputElem.scrollWidth}px`;
|