From bc1a92be039ab9394a8c0bdae653467c2cc92036 Mon Sep 17 00:00:00 2001 From: Krille Fear Date: Fri, 19 Nov 2021 11:02:05 +0100 Subject: [PATCH] fix: Stickers always in square --- lib/pages/chat/events/sticker.dart | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/lib/pages/chat/events/sticker.dart b/lib/pages/chat/events/sticker.dart index c937b3ab..8be80cf8 100644 --- a/lib/pages/chat/events/sticker.dart +++ b/lib/pages/chat/events/sticker.dart @@ -21,24 +21,11 @@ class _StickerState extends State { @override Widget build(BuildContext context) { - // stickers should default to a ratio of 1:1 - var ratio = 1.0; - // if a width and a height is specified for stickers, use those! - if (widget.event.infoMap['w'] is int && widget.event.infoMap['h'] is int) { - ratio = widget.event.infoMap['w'] / widget.event.infoMap['h']; - // make sure the ratio is within 0.9 - 2.0 - if (ratio > 2.0) { - ratio = 2.0; - } - if (ratio < 0.9) { - ratio = 0.9; - } - } return ImageBubble( widget.event, width: 400, - height: 400 / ratio, - fit: ratio <= 1.0 ? BoxFit.contain : BoxFit.cover, + height: 400, + fit: BoxFit.contain, onTap: () { setState(() => animated = true); showOkAlertDialog(