Fix improper width on certain emotes without size

This commit is contained in:
tommyxchow 2022-03-28 17:59:52 -04:00
parent 4a65da68a7
commit 9cd02b75d9
3 changed files with 6 additions and 5 deletions

View file

@ -391,7 +391,7 @@ class IRCMessage {
_createEmoteSpan(
emote: emote,
height: emote.height != null ? emote.height! * emoteScale : emoteSize,
width: emote.width != null ? emote.width! * emoteScale : emoteSize,
width: emote.width != null ? emote.width! * emoteScale : null,
),
);
}
@ -419,7 +419,7 @@ class IRCMessage {
_createEmoteSpan(
emote: emote,
height: emote.height != null ? emote.height! * emoteScale : emoteSize,
width: emote.width != null ? emote.width! * emoteScale : emoteSize,
width: emote.width != null ? emote.width! * emoteScale : null,
),
);
} else {
@ -525,7 +525,7 @@ class IRCMessage {
static WidgetSpan _createEmoteSpan({
required Emote emote,
required double height,
required double width,
required double? width,
}) {
const emoteType = [
'Twitch (Bits Tier)',
@ -572,6 +572,7 @@ class IRCMessage {
preferBelow: false,
child: CachedNetworkImage(
imageUrl: emote.url,
placeholder: (context, url) => const SizedBox(),
fadeInDuration: const Duration(),
height: height,
width: width,

View file

@ -46,7 +46,7 @@ class EmoteMenuSection extends StatelessWidget {
child: CachedNetworkImage(
imageUrl: emotes[index].url,
height: emotes[index].height?.toDouble() ?? defaultEmoteSize,
width: emotes[index].width?.toDouble() ?? defaultEmoteSize,
width: emotes[index].width?.toDouble(),
),
),
),

View file

@ -61,7 +61,7 @@ class RecentEmotesPanel extends StatelessWidget {
color: matchingEmotes.isNotEmpty ? null : const Color.fromRGBO(255, 255, 255, 0.5),
colorBlendMode: matchingEmotes.isNotEmpty ? null : BlendMode.modulate,
height: emote.height?.toDouble() ?? defaultEmoteSize,
width: emote.width?.toDouble() ?? defaultEmoteSize,
width: emote.width?.toDouble(),
),
),
),