@@ -725,10 +725,11 @@ class MessageMediaContainer extends StatelessWidget {
725725 final Widget ? child;
726726
727727 /// The container's size, in logical pixels.
728- static const size = Size (150 , 100 );
728+ static const baseSize = Size (150 , 100 );
729729
730730 @override
731731 Widget build (BuildContext context) {
732+ final store = PerAccountStoreWidget .of (context);
732733 return GestureDetector (
733734 onTap: onTap,
734735 child: UnconstrainedBox (
@@ -742,7 +743,7 @@ class MessageMediaContainer extends StatelessWidget {
742743 child: Padding (
743744 padding: const EdgeInsets .all (1 ),
744745 child: SizedBox .fromSize (
745- size: size ,
746+ size: baseSize * store.mediaPreviewSizeFactor ,
746747 child: child))))));
747748 }
748749}
@@ -1526,17 +1527,18 @@ class _Image extends StatelessWidget {
15261527
15271528 @override
15281529 Widget build (BuildContext context) {
1530+ final store = PerAccountStoreWidget .of (context);
15291531 final devicePixelRatio = MediaQuery .devicePixelRatioOf (context);
15301532
15311533 // Follow web's max-height behavior (10em);
15321534 // see image_box_em in web/src/postprocess_content.ts.
1533- final maxHeight = ambientTextStyle.fontSize! * 10 ;
1535+ final maxHeight = ambientTextStyle.fontSize! * 10 * store.mediaPreviewSizeFactor ;
15341536
15351537 final imageSize = (node.originalWidth != null && node.originalHeight != null )
15361538 ? Size (node.originalWidth! , node.originalHeight! ) / devicePixelRatio
15371539 // Layout plan when original dimensions are unknown:
15381540 // a [MessageMediaContainer]-sized and -colored rectangle.
1539- : MessageMediaContainer .size ;
1541+ : MessageMediaContainer .baseSize ;
15401542
15411543 // (a) Don't let tall, thin images take up too much vertical space,
15421544 // which could be annoying to scroll through. And:
@@ -1549,7 +1551,6 @@ class _Image extends StatelessWidget {
15491551 final size = BoxConstraints (maxHeight: maxHeight)
15501552 .constrainSizeAndAttemptToPreserveAspectRatio (imageSize);
15511553
1552- final store = PerAccountStoreWidget .of (context);
15531554 final message = InheritedMessage .of (context);
15541555
15551556 final resolvedSrc = switch (node.src) {
0 commit comments