Fix zero-width emotes sometimes wrapping lines incorrectly (#3389)

Co-authored-by: Felanbird <41973452+Felanbird@users.noreply.github.com>
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
Adam Davies
2021-12-06 16:49:08 -06:00
committed by GitHub
parent b41df18933
commit 937e33a2fd
2 changed files with 5 additions and 1 deletions
@@ -65,7 +65,10 @@ void MessageLayoutContainer::clear()
void MessageLayoutContainer::addElement(MessageLayoutElement *element)
{
if (!this->fitsInLine(element->getRect().width()))
bool isZeroWidth =
element->getFlags().has(MessageElementFlag::ZeroWidthEmote);
if (!isZeroWidth && !this->fitsInLine(element->getRect().width()))
{
this->breakLine();
}