@@ -383,27 +383,18 @@ class _TextEmoji extends StatelessWidget {
383
383
384
384
/// The size of a square emoji (Unicode or image).
385
385
///
386
- /// Should be scaled by [_emojiTextScalerClamped] .
387
- const _squareEmojiSize = 24 .0 ;
386
+ /// This is the exact size we want emojis to be rendered at .
387
+ const _squareEmojiSize = 25 .0 ;
388
388
389
- /// A font size that, with Noto Color Emoji and our line-height config,
390
- /// causes a Unicode emoji to occupy a [_squareEmojiSize] square in the layout.
391
- ///
392
- /// Determined experimentally:
393
- /// <https://github.com/zulip/zulip-flutter/pull/410#discussion_r1402808701>
394
- const _notoColorEmojiTextSize = 16.0 ;
389
+ /// A font size that, with Noto Color Emoji, renders at exactly our desired size.
390
+ /// This matches _squareEmojiSize since we use a height of 1.0 in the text style.
391
+ const _notoColorEmojiTextSize = 21.0 ;
395
392
396
- /// A [TextScaler] that limits Unicode and image emojis' max scale factor,
397
- /// to leave space for the label.
398
- ///
399
- /// This should scale [_squareEmojiSize] for Unicode and image emojis.
400
- // TODO(a11y) clamp higher?
393
+ /// A [TextScaler] that maintains accessibility while preventing emojis from getting too large
401
394
TextScaler _squareEmojiScalerClamped (BuildContext context) =>
402
- MediaQuery .textScalerOf (context).clamp (maxScaleFactor: 2 );
395
+ MediaQuery .textScalerOf (context).clamp (maxScaleFactor: 1.5 );
403
396
404
- /// A [TextScaler] that limits text emojis' max scale factor,
405
- /// to minimize the need for line breaks.
406
- // TODO(a11y) clamp higher?
397
+ /// A [TextScaler] for text emojis that maintains accessibility while preventing excessive wrapping
407
398
TextScaler _textEmojiScalerClamped (BuildContext context) =>
408
399
MediaQuery .textScalerOf (context).clamp (maxScaleFactor: 1.5 );
409
400
0 commit comments