diff --git a/CHANGELOG.md b/CHANGELOG.md index 498aec9ac..ba5611f7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -65,6 +65,7 @@ - Bugfix: Fixed IRC highlights not triggering sounds or alerts properly. (#3368) - Bugfix: Fixed IRC /kick command crashing if parameters were malformed. (#3382) - Bugfix: Fixed a crash that could occur on certain Linux systems when toggling the Always on Top flag. (#3385) +- Bugfix: Fixed zero-width emotes sometimes wrapping lines incorrectly. (#3389) - Dev: Add GitHub action to test builds without precompiled headers enabled. (#3327) - Dev: Renamed CMake's build option `USE_SYSTEM_QT5KEYCHAIN` to `USE_SYSTEM_QTKEYCHAIN`. (#3103) - Dev: Add benchmarks that can be compiled with the `BUILD_BENCHMARKS` CMake flag. Off by default. (#3038) diff --git a/src/messages/layouts/MessageLayoutContainer.cpp b/src/messages/layouts/MessageLayoutContainer.cpp index 66e533069..5fca4008a 100644 --- a/src/messages/layouts/MessageLayoutContainer.cpp +++ b/src/messages/layouts/MessageLayoutContainer.cpp @@ -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(); }