diff --git a/src/messages/MessageElement.hpp b/src/messages/MessageElement.hpp index 034938450..8da2bdf9c 100644 --- a/src/messages/MessageElement.hpp +++ b/src/messages/MessageElement.hpp @@ -42,6 +42,7 @@ enum class MessageElementFlag { BttvEmote = BttvEmoteImage | BttvEmoteText, ChannelPointReward = (1 << 8), + ChannelPointRewardImage = ChannelPointReward | TwitchEmoteImage, FfzEmoteImage = (1 << 10), FfzEmoteText = (1 << 11), diff --git a/src/messages/layouts/MessageLayoutContainer.cpp b/src/messages/layouts/MessageLayoutContainer.cpp index 9c46e0c27..543b3f4e8 100644 --- a/src/messages/layouts/MessageLayoutContainer.cpp +++ b/src/messages/layouts/MessageLayoutContainer.cpp @@ -123,9 +123,20 @@ void MessageLayoutContainer::_addElement(MessageLayoutElement *element, xOffset -= element->getRect().width() + this->spaceWidth_; } + auto yOffset = 0; + + if (element->getCreator().getFlags().has( + MessageElementFlag::ChannelPointReward) && + element->getCreator().getFlags().hasNone( + {MessageElementFlag::TwitchEmoteImage})) + { + yOffset -= (this->margin.top * this->scale_); + } + // set move element - element->setPosition(QPoint(this->currentX_ + xOffset, - this->currentY_ - element->getRect().height())); + element->setPosition( + QPoint(this->currentX_ + xOffset, + this->currentY_ - element->getRect().height() + yOffset)); // add element this->elements_.push_back(std::unique_ptr(element)); diff --git a/src/providers/twitch/TwitchMessageBuilder.cpp b/src/providers/twitch/TwitchMessageBuilder.cpp index 1d6849820..0e64beaf4 100644 --- a/src/providers/twitch/TwitchMessageBuilder.cpp +++ b/src/providers/twitch/TwitchMessageBuilder.cpp @@ -1158,7 +1158,7 @@ void TwitchMessageBuilder::appendChannelPointRewardMessage( reward.title, MessageElementFlag::ChannelPointReward, MessageColor::Text, FontStyle::ChatMediumBold); builder->emplace( - reward.image, MessageElementFlag::ChannelPointReward); + reward.image, MessageElementFlag::ChannelPointRewardImage); builder->emplace( QString::number(reward.cost), MessageElementFlag::ChannelPointReward, MessageColor::Text, FontStyle::ChatMediumBold);