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
|
// check if timestamp format changed
|
||||||
bool timestampFormatChanged = this->timestampFormat != app->settings->timestampFormat;
|
bool timestampFormatChanged = this->timestampFormat != app->settings->timestampFormat;
|
||||||
|
this->timestampFormat = app->settings->timestampFormat.getValue();
|
||||||
|
|
||||||
layoutRequired |= timestampFormatChanged;
|
layoutRequired |= timestampFormatChanged;
|
||||||
|
|
||||||
@@ -86,6 +87,8 @@ bool MessageLayout::layout(int width, float scale, MessageElement::Flags flags)
|
|||||||
imagesChanged |= scaleChanged;
|
imagesChanged |= scaleChanged;
|
||||||
textChanged |= scaleChanged;
|
textChanged |= scaleChanged;
|
||||||
|
|
||||||
|
// assert(layoutRequired);
|
||||||
|
|
||||||
// update word sizes if needed
|
// update word sizes if needed
|
||||||
if (imagesChanged) {
|
if (imagesChanged) {
|
||||||
// this->container.updateImages();
|
// this->container.updateImages();
|
||||||
@@ -100,6 +103,8 @@ bool MessageLayout::layout(int width, float scale, MessageElement::Flags flags)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// return if no layout is required
|
// return if no layout is required
|
||||||
|
qDebug() << layoutRequired;
|
||||||
|
|
||||||
if (!layoutRequired) {
|
if (!layoutRequired) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -123,8 +128,6 @@ void MessageLayout::actuallyLayout(int width, MessageElement::Flags _flags)
|
|||||||
this->container.begin(width, this->scale, messageFlags);
|
this->container.begin(width, this->scale, messageFlags);
|
||||||
|
|
||||||
for (const std::unique_ptr<MessageElement> &element : this->message->getElements()) {
|
for (const std::unique_ptr<MessageElement> &element : this->message->getElements()) {
|
||||||
BenchmarkGuard guard("addelement");
|
|
||||||
|
|
||||||
element->addToContainer(this->container, _flags);
|
element->addToContainer(this->container, _flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user