* @public * @param {string} text * @param {string} font * @param {string} [textAlign='left'] * @param {string} [textVerticalAlign='top'] * @param {Array. } [textPadding] * @param {Object} [rich] * @param {Object} [truncate] * @return {Object} {x, y, width, height, lineHeight}
(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, rich, truncate)
| 7636 | * @return {Object} {x, y, width, height, lineHeight} |
| 7637 | */ |
| 7638 | function getBoundingRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, rich, truncate) { |
| 7639 | return rich |
| 7640 | ? getRichTextRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, rich, truncate) |
| 7641 | : getPlainTextRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, truncate); |
| 7642 | } |
| 7643 | |
| 7644 | function getPlainTextRect(text, font, textAlign, textVerticalAlign, textPadding, textLineHeight, truncate) { |
| 7645 | var contentBlock = parsePlainText(text, font, textPadding, textLineHeight, truncate); |
no test coverage detected