Showing
2 changed files
with
1 additions
and
16 deletions
1 | import ComponentInterface from "./ComponentInterface" | 1 | import ComponentInterface from "./ComponentInterface" |
2 | import Color from "./Color" | 2 | import Color from "./Color" |
3 | -import Hangul from "hangul-js" | ||
4 | 3 | ||
5 | class Text extends ComponentInterface { | 4 | class Text extends ComponentInterface { |
6 | constructor(fabricObj) { | 5 | constructor(fabricObj) { |
7 | super(); | 6 | super(); |
8 | this.color = new Color(fabricObj.fill); | 7 | this.color = new Color(fabricObj.fill); |
9 | - this.text = { | 8 | + this.text = fabricObj.text; |
10 | - plain:fabricObj.text, | ||
11 | - splited:Hangul.disassemble(fabricObj.text) | ||
12 | - }; | ||
13 | this.position = { | 9 | this.position = { |
14 | top:fabricObj.top, | 10 | top:fabricObj.top, |
15 | left:fabricObj.left | 11 | left:fabricObj.left | ... | ... |
package-lock.json
deleted
100644 → 0
1 | -{ | ||
2 | - "requires": true, | ||
3 | - "lockfileVersion": 1, | ||
4 | - "dependencies": { | ||
5 | - "hangul-js": { | ||
6 | - "version": "0.2.6", | ||
7 | - "resolved": "https://registry.npmjs.org/hangul-js/-/hangul-js-0.2.6.tgz", | ||
8 | - "integrity": "sha512-48axU8LgjCD30FEs66Xc04/8knxMwCMQw0f67l67rlttW7VXT3qRJgQeHmhiuGwWXGvSbk6YM0fhQlcjE1JFQA==" | ||
9 | - } | ||
10 | - } | ||
11 | -} |
-
Please register or login to post a comment