Make ModBadgeElement a descendant of BadgeElement instead of EmoteElement (#1602)

this causes it to behave as it should, and not be scaled when emotes are
scaled. :)
This commit is contained in:
pajlada
2020-03-14 08:06:24 -04:00
committed by GitHub
parent 9a8b85e338
commit 0f2355459d
3 changed files with 44 additions and 28 deletions
+14 -11
View File
@@ -223,17 +223,6 @@ private:
EmotePtr emote_;
};
// Behaves like an emote element, except it creates a different image layout element that draws the mod badge background
class ModBadgeElement : public EmoteElement
{
public:
ModBadgeElement(const EmotePtr &data, MessageElementFlags flags_);
protected:
MessageLayoutElement *makeImageLayoutElement(const ImagePtr &image,
const QSize &size) override;
};
class BadgeElement : public MessageElement
{
public:
@@ -244,10 +233,24 @@ public:
EmotePtr getEmote() const;
protected:
virtual MessageLayoutElement *makeImageLayoutElement(const ImagePtr &image,
const QSize &size);
private:
EmotePtr emote_;
};
class ModBadgeElement : public BadgeElement
{
public:
ModBadgeElement(const EmotePtr &data, MessageElementFlags flags_);
protected:
MessageLayoutElement *makeImageLayoutElement(const ImagePtr &image,
const QSize &size) override;
};
// contains a text, formated depending on the preferences
class TimestampElement : public MessageElement
{