Skip to content

Commit

Permalink
stop 4x emotes from rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
TroyKomodo committed Apr 5, 2022
1 parent 1e06164 commit ec7d0a0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/messages/ImageSet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,10 @@ const std::shared_ptr<Image> &getImagePriv(const ImageSet &set, float scale)
else if (scale > 1.001f)
quality = 2;

if (!set.getImage4()->isEmpty() && quality == 4)
{
return set.getImage4();
}
// if (!set.getImage4()->isEmpty() && quality == 4)
// {
// return set.getImage4();
// }

if (!set.getImage3()->isEmpty() && quality >= 3)
{
Expand Down
18 changes: 16 additions & 2 deletions src/providers/seventv/SeventvEmotes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,23 @@ namespace {
bool zeroWidth =
visibilityFlags.has(SeventvEmoteVisibilityFlag::ZeroWidth);

auto heightArr = jsonEmote.toObject().value("height").toArray();
auto size2x = heightArr.at(1).toDouble();
auto size3x = heightArr.at(2).toDouble();
auto size4x = heightArr.at(3).toDouble();
if (heightArr.size() != 4 || size2x <= 48) {
size2x = 0.66;
size3x = 0.42;
} else {
size2x = 0.5;
size3x = 0.33;
}

auto emote = Emote(
{name,
ImageSet{Image::fromUrl(getEmoteLink(id, "1x"), 1),
// Image::fromUrl(getEmoteLink(id, "2x"), 0.66),
// Image::fromUrl(getEmoteLink(id, "3x"), 0.42),
Image::fromUrl(getEmoteLink(id, "2x"), size2x),
Image::fromUrl(getEmoteLink(id, "3x"), size3x),
Image::fromUrl(getEmoteLink(id, "4x"), 0.25)},
Tooltip{QString("%1<br>%2 7TV Emote<br>By: %3")
.arg(name.string, (isGlobal ? "Global" : "Channel"),
Expand Down Expand Up @@ -156,6 +168,7 @@ void SeventvEmotes::loadEmotes()
provider_id
visibility
mime
height
owner {
id
display_name
Expand Down Expand Up @@ -216,6 +229,7 @@ void SeventvEmotes::loadChannel(std::weak_ptr<Channel> channel,
provider_id
visibility
mime
height
owner {
id
display_name
Expand Down

0 comments on commit ec7d0a0

Please sign in to comment.