(item)
| 122883 | return item.limit > 0 && text5.length ? truncate(item, text5) : text5; |
| 122884 | } |
| 122885 | function widthGetter(item) { |
| 122886 | if (textMetrics.width === measureWidth) { |
| 122887 | // we are using canvas |
| 122888 | const currentFont = font(item); |
| 122889 | return (text6)=>_measureWidth(text6, currentFont); |
| 122890 | } else { |
| 122891 | // we are relying on estimates |
| 122892 | const currentFontHeight = fontSize(item); |
| 122893 | return (text7)=>_estimateWidth(text7, currentFontHeight); |
| 122894 | } |
| 122895 | } |
| 122896 | function truncate(item, text8) { |
| 122897 | var limit = +item.limit, width = widthGetter(item); |
| 122898 | if (width(text8) < limit) return text8; |
no test coverage detected