Chatterino / chatterino2

Chat client for https://twitch.tv
MIT License
2.06k stars 448 forks source link

Zero-width emotes can't be last on line when text wrapped #3147

Closed IS2511 closed 2 years ago

IS2511 commented 3 years ago

Describe your issue Zero-width emotes can't be last on line when text wrapped. See screenshot

Screenshots Screenshot at 2021-08-08 01-08-53 Right most row of pepeL emotes is not covered in cvHazmat. The cvHazmat emotes instead are wrapped to new line

OS and Chatterino Version OS: Linux mainPC 5.10.0-8parrot1-amd64 #1 SMP Debian 5.10.46-8parrot1 (2021-07-21) x86_64 GNU/Linux Chatterino: Chatterino 7.3.3 (commit 20a7127)

pajlada commented 3 years ago

Just as a note, while we call them zero width emotes both in chat and in code, they are technically full width emote with a X margin equal to their negative width plus the width of a space - that's why they behave like this.

Changes would need to be made to the text-wrapping code to take into account the MessageElementFlag::ZeroWidthEmote when doing the MessageLayoutContainer::fitsInLine call

yannismate commented 3 years ago

This issue is probably related - if you post one of those emotes at the beginning of the message without another emote to put it onto, it gets displayed on top of the username image

JunkiEDM commented 3 years ago

This issue is probably related - if you post one of those emotes at the beginning of the message without another emote to put it onto, it gets displayed on top of the username image

This was mentioned in #1433 and even though it's unintended I think it presents more options for creative use than issues, especially with some 7tv zero-width emotes relying on this "bug". Even though that's a third party thing and doesn't present issues in this project specifically, I still think it should be considered since any changes made to zero-width emotes here would affect the way 7tv zero-width emotes work in their fork as well.