mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Only update text if something changed
We were calling this even if we didn't really change anything and paths are expensive to paint. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
d2c5770ae1
commit
947010991d
1 changed files with 12 additions and 5 deletions
|
@ -24,8 +24,10 @@ DiveTextItem::DiveTextItem(QGraphicsItem *parent) : QGraphicsItemGroup(parent),
|
||||||
|
|
||||||
void DiveTextItem::setAlignment(int alignFlags)
|
void DiveTextItem::setAlignment(int alignFlags)
|
||||||
{
|
{
|
||||||
internalAlignFlags = alignFlags;
|
if (alignFlags != internalAlignFlags) {
|
||||||
updateText();
|
internalAlignFlags = alignFlags;
|
||||||
|
updateText();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiveTextItem::setBrush(const QBrush &b)
|
void DiveTextItem::setBrush(const QBrush &b)
|
||||||
|
@ -35,13 +37,18 @@ void DiveTextItem::setBrush(const QBrush &b)
|
||||||
|
|
||||||
void DiveTextItem::setScale(double newscale)
|
void DiveTextItem::setScale(double newscale)
|
||||||
{
|
{
|
||||||
scale = newscale;
|
if (scale != newscale) {
|
||||||
|
scale = newscale;
|
||||||
|
updateText();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void DiveTextItem::setText(const QString &t)
|
void DiveTextItem::setText(const QString &t)
|
||||||
{
|
{
|
||||||
internalText = t;
|
if (internalText != t) {
|
||||||
updateText();
|
internalText = t;
|
||||||
|
updateText();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const QString &DiveTextItem::text()
|
const QString &DiveTextItem::text()
|
||||||
|
|
Loading…
Add table
Reference in a new issue