fixed performance
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user