mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
fixed performance
This commit is contained in:
parent
6ee4945715
commit
ec03bc2e8c
1 changed files with 5 additions and 2 deletions
|
@ -76,6 +76,7 @@ bool MessageLayout::layout(int width, float scale, MessageElement::Flags flags)
|
|||
|
||||
// check if timestamp format changed
|
||||
bool timestampFormatChanged = this->timestampFormat != app->settings->timestampFormat;
|
||||
this->timestampFormat = app->settings->timestampFormat.getValue();
|
||||
|
||||
layoutRequired |= timestampFormatChanged;
|
||||
|
||||
|
@ -86,6 +87,8 @@ bool MessageLayout::layout(int width, float scale, MessageElement::Flags flags)
|
|||
imagesChanged |= scaleChanged;
|
||||
textChanged |= scaleChanged;
|
||||
|
||||
// assert(layoutRequired);
|
||||
|
||||
// update word sizes if needed
|
||||
if (imagesChanged) {
|
||||
// this->container.updateImages();
|
||||
|
@ -100,6 +103,8 @@ bool MessageLayout::layout(int width, float scale, MessageElement::Flags flags)
|
|||
}
|
||||
|
||||
// return if no layout is required
|
||||
qDebug() << layoutRequired;
|
||||
|
||||
if (!layoutRequired) {
|
||||
return false;
|
||||
}
|
||||
|
@ -123,8 +128,6 @@ void MessageLayout::actuallyLayout(int width, MessageElement::Flags _flags)
|
|||
this->container.begin(width, this->scale, messageFlags);
|
||||
|
||||
for (const std::unique_ptr<MessageElement> &element : this->message->getElements()) {
|
||||
BenchmarkGuard guard("addelement");
|
||||
|
||||
element->addToContainer(this->container, _flags);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue