From b45262c75b7f846d1d96c6004296fd407f5462e8 Mon Sep 17 00:00:00 2001 From: Ashil <77285023+ashilkn@users.noreply.github.com> Date: Fri, 3 May 2024 19:57:01 +0530 Subject: [PATCH] [mob][photos] band aid fix for word gettng cut to next line in SelectionActionButton (#1607) --- .../bottom_action_bar/selection_action_button_widget.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mobile/lib/ui/components/bottom_action_bar/selection_action_button_widget.dart b/mobile/lib/ui/components/bottom_action_bar/selection_action_button_widget.dart index 60db98cf4f..5ca6a25dcc 100644 --- a/mobile/lib/ui/components/bottom_action_bar/selection_action_button_widget.dart +++ b/mobile/lib/ui/components/bottom_action_bar/selection_action_button_widget.dart @@ -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; } }