(maxWidth, maxHeight)
| 27 | } |
| 28 | |
| 29 | update(maxWidth, maxHeight) { |
| 30 | const opts = this.options; |
| 31 | |
| 32 | this.left = 0; |
| 33 | this.top = 0; |
| 34 | |
| 35 | if (!opts.display) { |
| 36 | this.width = this.height = this.right = this.bottom = 0; |
| 37 | return; |
| 38 | } |
| 39 | |
| 40 | this.width = this.right = maxWidth; |
| 41 | this.height = this.bottom = maxHeight; |
| 42 | |
| 43 | const lineCount = isArray(opts.text) ? opts.text.length : 1; |
| 44 | this._padding = toPadding(opts.padding); |
| 45 | const textSize = lineCount * toFont(opts.font).lineHeight + this._padding.height; |
| 46 | |
| 47 | if (this.isHorizontal()) { |
| 48 | this.height = textSize; |
| 49 | } else { |
| 50 | this.width = textSize; |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | isHorizontal() { |
| 55 | const pos = this.options.position; |
nothing calls this directly
no test coverage detected