text-ellipsis-core
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "text-ellipsis-core", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "the core of text-ellipsis.", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
# text-ellipsis-core | ||
the core of text-ellipsis. |
@@ -22,3 +22,3 @@ // const getLengthByCanvas = (ctx, font = {}) => { | ||
if (beginLine > font.lineNum) break; | ||
const left = beginLine === font.lineNum ? font.left : ''; | ||
const left = beginLine === parseInt(font.lineNum, 10) ? font.left : ''; | ||
const str = font.text.substr(index, i - index) + left; | ||
@@ -25,0 +25,0 @@ const len = getLengthByDom( |
12080