Просмотр исходного кода

fix Ellipsis floor-mid to ceil-mid #1258 (#1680)

niko 7 лет назад
Родитель
Сommit
0f9f76783a
1 измененных файлов с 1 добавлено и 1 удалено
  1. 1 1
      src/components/Ellipsis/index.js

+ 1 - 1
src/components/Ellipsis/index.js

@@ -109,7 +109,7 @@ export default class Ellipsis extends Component {
 
       // bisection
       const len = text.length;
-      const mid = Math.floor(len / 2);
+      const mid = Math.ceil(len / 2);
 
       const count = this.bisection(targetHeight, mid, 0, len, text, shadowNode);