@@ -57,7 +57,7 @@ function SmartLabelManager(container, useEllipses, options) {
5757
5858 // Get a context of canvas
5959 this . ctx = canvas && canvas . getContext && canvas . getContext ( '2d' ) ;
60-
60+
6161 this . _containerManager = new ContainerManager ( wrapper , isBrowserLess , 10 ) ;
6262 this . _showNoEllipses = ! useEllipses ;
6363 this . _init = true ;
@@ -223,7 +223,7 @@ SmartLabelManager.prototype._isSameStyle = function () {
223223} ;
224224/**
225225 * Sets font property of canvas context based on which the width of text is calculated.
226- *
226+ *
227227 * @param {any } style style configuration which affects the text size
228228 * {
229229 * fontSize / 'font-size' : MUST BE FOLLOWED BY PX (10px, 11px)
@@ -448,8 +448,8 @@ SmartLabelManager.prototype.getSmartText = function (text, maxWidth, maxHeight,
448448 /**
449449 * For canvas lineHeight is directly used. In some cases, lineHeight can be 0.x pixels greater than
450450 * maxHeight. Previously, div was used to calculate lineHeight and it used to return a rounded number.
451- *
452- * Adding a buffer of 1px, maxheight will be increased by a factor of 1.2 only when
451+ *
452+ * Adding a buffer of 1px, maxheight will be increased by a factor of 1.2 only when
453453 * 0 <= (lineHeight - maxHeight) <= 1
454454 */
455455 if ( ( lineHeight - maxHeight <= 1 ) && ( lineHeight - maxHeight >= 0 ) ) {
@@ -503,7 +503,7 @@ SmartLabelManager.prototype.getSmartText = function (text, maxWidth, maxHeight,
503503 text = fastTrim ( text ) . replace ( / ( \s + ) / g, ' ' ) ;
504504 maxWidthWithEll = this . _showNoEllipses ? maxWidth : ( maxWidth - ellipsesWidth ) ;
505505
506- // Checks if any html tag is present. This if block is executed for all normal texts and
506+ // Checks if any html tag is present. This if block is executed for all normal texts and
507507 // all texts containing only <br /> tag.
508508 if ( ! hasHTMLTag || hasOnlyBrTag ) {
509509 // Gets splitted array
@@ -557,7 +557,7 @@ SmartLabelManager.prototype.getSmartText = function (text, maxWidth, maxHeight,
557557 if ( tempArr [ i ] === '<br />' ) {
558558 strHeight += this . _lineHeight ;
559559 lastIndexBroken = i ;
560-
560+
561561 maxStrWidth = max ( maxStrWidth , strWidth ) ;
562562 strWidth = 0 ;
563563 trimStr = null ;
@@ -585,7 +585,8 @@ SmartLabelManager.prototype.getSmartText = function (text, maxWidth, maxHeight,
585585 smartLabel . text = fastTrim ( trimStr ) + ellipsesStr ;
586586 smartLabel . tooltext = smartLabel . oriText ;
587587 smartLabel . width = max ( maxStrWidth , strWidth ) ;
588- smartLabel . height = strHeight ;
588+ smartLabel . height = strHeight ;
589+ smartLabel . isTruncated = true ;
589590 return smartLabel ;
590591 }
591592 }
@@ -619,7 +620,8 @@ SmartLabelManager.prototype.getSmartText = function (text, maxWidth, maxHeight,
619620 smartLabel . text = fastTrim ( trimStr ) + ellipsesStr ;
620621 smartLabel . tooltext = toolText ;
621622 smartLabel . width = maxStrWidth ;
622- smartLabel . height = strHeight - this . _lineHeight ;
623+ smartLabel . height = strHeight - this . _lineHeight ;
624+ smartLabel . isTruncated = true ;
623625 return smartLabel ;
624626 }
625627 }
@@ -681,7 +683,8 @@ SmartLabelManager.prototype.getSmartText = function (text, maxWidth, maxHeight,
681683 smartLabel . tooltext = smartLabel . oriText ;
682684 // The max width among all the lines will be the width of the string.
683685 smartLabel . width = maxWidth ;
684- smartLabel . height = ( strHeight - this . _lineHeight ) ;
686+ smartLabel . height = ( strHeight - this . _lineHeight ) ;
687+ smartLabel . isTruncated = true ;
685688 return smartLabel ;
686689 } else {
687690 maxStrWidth = max ( maxStrWidth , strWidth ) ;
@@ -1023,4 +1026,4 @@ SmartLabelManager.prototype.dispose = function () {
10231026 return this ;
10241027} ;
10251028
1026- export default SmartLabelManager ;
1029+ export default SmartLabelManager ;
0 commit comments