(main)
| 4 | |
| 5 | export default class TextTool { |
| 6 | constructor(main) { |
| 7 | this.ctx = main.ctx; |
| 8 | this.el = main.toolContainer; |
| 9 | this.main = main; |
| 10 | this.wrapper = main.wrapper; |
| 11 | this.input = this.el.querySelector('.ptro-text-tool-input'); |
| 12 | this.inputWrapper = this.el.querySelector('.ptro-text-tool-input-wrapper'); |
| 13 | this.inputWrapper.style.display = 'none'; |
| 14 | this.isBold = main.params.defaultFontBold; |
| 15 | this.isItalic = main.params.defaultFontItalic; |
| 16 | this.strokeOn = main.params.defaultTextStrokeAndShadow; |
| 17 | |
| 18 | this.strokeColor = main.params.textStrokeAlphaColor; |
| 19 | this.setFontSize(main.params.defaultFontSize); |
| 20 | this.setFont(this.getFonts()[0].value); |
| 21 | this.setFontIsBold(this.isBold); |
| 22 | this.setFontIsItalic(this.isItalic); |
| 23 | |
| 24 | this.el.querySelector('.ptro-text-tool-apply').onclick = () => { |
| 25 | this.apply(); |
| 26 | }; |
| 27 | |
| 28 | this.el.querySelector('.ptro-text-tool-cancel').onclick = () => { |
| 29 | this.close(); |
| 30 | }; |
| 31 | } |
| 32 | |
| 33 | getFont() { |
| 34 | return this.font; |
nothing calls this directly
no test coverage detected