[mob][photos] band aid fix for word gettng cut to next line in SelectionActionButton (#1607)

This commit is contained in:
Ashil 2024-05-03 19:57:01 +05:30 committed by GitHub
parent 7f6e8228af
commit b45262c75b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -132,14 +132,15 @@ class __BodyState extends State<_Body> {
return maxWidth;
}
//Todo: this doesn't give the correct width of the word, make it right
double computeWidthOfWord(String text, TextStyle style) {
final textPainter = TextPainter(
text: TextSpan(text: text, style: style),
maxLines: 1,
textDirection: TextDirection.ltr,
textScaleFactor: MediaQuery.of(context).textScaleFactor,
textScaler: MediaQuery.textScalerOf(context),
)..layout();
return textPainter.size.width;
//buffer of 8 added as width is shorter than actual text width
return textPainter.size.width + 8;
}
}