mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Remove bad asserts from IRC text wrapping code (#2446)
This commit is contained in:
parent
4a53472215
commit
303b079257
1 changed files with 3 additions and 3 deletions
|
@ -611,7 +611,7 @@ void IrcTextElement::addToContainer(MessageLayoutContainer &container,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// we done goofed, we need to wrap the text
|
// The word does not fit on a new line, we need to wrap it
|
||||||
QString text = word.text;
|
QString text = word.text;
|
||||||
std::vector<Segment> segments = word.segments;
|
std::vector<Segment> segments = word.segments;
|
||||||
int textLength = text.length();
|
int textLength = text.length();
|
||||||
|
@ -625,6 +625,7 @@ void IrcTextElement::addToContainer(MessageLayoutContainer &container,
|
||||||
{
|
{
|
||||||
if (!container.canAddElements())
|
if (!container.canAddElements())
|
||||||
{
|
{
|
||||||
|
// The container does not allow any more elements to be added, stop here
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -638,11 +639,10 @@ void IrcTextElement::addToContainer(MessageLayoutContainer &container,
|
||||||
{
|
{
|
||||||
std::vector<Segment> pieceSegments;
|
std::vector<Segment> pieceSegments;
|
||||||
int charactersLeft = i - wordStart;
|
int charactersLeft = i - wordStart;
|
||||||
assert(charactersLeft > 0);
|
|
||||||
for (auto segmentIt = segments.begin();
|
for (auto segmentIt = segments.begin();
|
||||||
segmentIt != segments.end();)
|
segmentIt != segments.end();)
|
||||||
{
|
{
|
||||||
assert(charactersLeft > 0);
|
|
||||||
auto &segment = *segmentIt;
|
auto &segment = *segmentIt;
|
||||||
if (charactersLeft >= segment.text.length())
|
if (charactersLeft >= segment.text.length())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue