mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Fix zero-width emotes alignment with removeSpacesBetweenEmotes setting (#3249)
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
parent
50b02f099a
commit
5112ec73b0
|
@ -32,6 +32,7 @@
|
|||
- Bugfix: Fixed own IRC messages not having metadata and a link to a usercard. (#3203)
|
||||
- Bugfix: Fixed some channels still not loading in rare cases. (#3219)
|
||||
- Bugfix: Fixed a bug with usernames or emotes completing from the wrong position. (#3229)
|
||||
- Bugfix: Fixed a bug that caused zero-width emotes to be misaligned when the "Remove spaces between emotes" setting is on. (#3249)
|
||||
- Bugfix: Fixed second chatterino icon appearing in the dock when restarting on a crash in macOS. (#3268)
|
||||
- Bugfix: Fixed the "Change channel" popup showing a wrong window title (#3273)
|
||||
- Bugfix: Fixed built-in Chatterino commands not working in whispers and mentions special channels (#3288)
|
||||
|
|
|
@ -147,9 +147,10 @@ void MessageLayoutContainer::_addElement(MessageLayoutElement *element,
|
|||
this->lineHeight_ = std::max(this->lineHeight_, newLineHeight);
|
||||
|
||||
auto xOffset = 0;
|
||||
bool isZeroWidthEmote = element->getCreator().getFlags().has(
|
||||
MessageElementFlag::ZeroWidthEmote);
|
||||
|
||||
if (element->getCreator().getFlags().has(
|
||||
MessageElementFlag::ZeroWidthEmote))
|
||||
if (isZeroWidthEmote)
|
||||
{
|
||||
xOffset -= element->getRect().width() + this->spaceWidth_;
|
||||
}
|
||||
|
@ -166,7 +167,7 @@ void MessageLayoutContainer::_addElement(MessageLayoutElement *element,
|
|||
|
||||
if (getSettings()->removeSpacesBetweenEmotes &&
|
||||
element->getFlags().hasAny({MessageElementFlag::EmoteImages}) &&
|
||||
shouldRemoveSpaceBetweenEmotes())
|
||||
!isZeroWidthEmote && shouldRemoveSpaceBetweenEmotes())
|
||||
{
|
||||
// Move cursor one 'space width' to the left to combine hug the previous emote
|
||||
this->currentX_ -= this->spaceWidth_;
|
||||
|
@ -183,8 +184,7 @@ void MessageLayoutContainer::_addElement(MessageLayoutElement *element,
|
|||
this->elements_.push_back(std::unique_ptr<MessageLayoutElement>(element));
|
||||
|
||||
// set current x
|
||||
if (!element->getCreator().getFlags().has(
|
||||
MessageElementFlag::ZeroWidthEmote))
|
||||
if (!isZeroWidthEmote)
|
||||
{
|
||||
this->currentX_ += element->getRect().width();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue