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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -65,6 +65,7 @@
- Bugfix: Fixed IRC highlights not triggering sounds or alerts properly. (#3368) - Bugfix: Fixed IRC highlights not triggering sounds or alerts properly. (#3368)
- Bugfix: Fixed IRC /kick command crashing if parameters were malformed. (#3382) - 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 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: 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: 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) - Dev: Add benchmarks that can be compiled with the `BUILD_BENCHMARKS` CMake flag. Off by default. (#3038)

View file

@ -65,7 +65,10 @@ void MessageLayoutContainer::clear()
void MessageLayoutContainer::addElement(MessageLayoutElement *element) 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(); this->breakLine();
} }