Skip to content

Commit

Permalink
improve text approximation
Browse files Browse the repository at this point in the history
reduce chances of an text approximation that is too
small
  • Loading branch information
greensopinion authored and mvarendorff committed Jan 13, 2022
1 parent 796ce7a commit 5c56e0f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/features/text_renderer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class TextApproximation {
textSize = textSize / context.zoomScaleFactor;
}
final approximateWidth =
(textSize / 2 * (text.length + 1)).roundToDouble();
final approximateHeight = (textSize * 1.25).roundToDouble();
(textSize / 1.9 * (text.length + 1)).ceilToDouble();
final approximateHeight = (textSize * 1.28).ceilToDouble();
final size = Size(approximateWidth, approximateHeight);
_size = size;
_translation = _offset(size, style.textLayout!.anchor);
Expand Down

0 comments on commit 5c56e0f

Please sign in to comment.