Fixed too much text being copied when copying chat messages (#4812)
* fix: selection copying too much * chore: add changelog entry * Update changelog entry --------- Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
@@ -125,9 +125,9 @@ void ImageLayoutElement::addCopyTextToString(QString &str, uint32_t from,
|
||||
{
|
||||
str += emoteElement->getEmote()->getCopyString();
|
||||
str = TwitchEmotes::cleanUpEmoteCode(str);
|
||||
if (this->hasTrailingSpace())
|
||||
if (this->hasTrailingSpace() && to >= 2)
|
||||
{
|
||||
str += " ";
|
||||
str += ' ';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -217,9 +217,9 @@ void LayeredImageLayoutElement::addCopyTextToString(QString &str, uint32_t from,
|
||||
{
|
||||
// cleaning is taken care in call
|
||||
str += layeredEmoteElement->getCleanCopyString();
|
||||
if (this->hasTrailingSpace())
|
||||
if (this->hasTrailingSpace() && to >= 2)
|
||||
{
|
||||
str += " ";
|
||||
str += ' ';
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -416,9 +416,9 @@ void TextLayoutElement::addCopyTextToString(QString &str, uint32_t from,
|
||||
{
|
||||
str += this->getText().mid(from, to - from);
|
||||
|
||||
if (this->hasTrailingSpace())
|
||||
if (this->hasTrailingSpace() && to > this->getText().length())
|
||||
{
|
||||
str += " ";
|
||||
str += ' ';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user