mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +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)
|
||||
{
|
||||
internalAlignFlags = alignFlags;
|
||||
updateText();
|
||||
if (alignFlags != internalAlignFlags) {
|
||||
internalAlignFlags = alignFlags;
|
||||
updateText();
|
||||
}
|
||||
}
|
||||
|
||||
void DiveTextItem::setBrush(const QBrush &b)
|
||||
|
@ -35,13 +37,18 @@ void DiveTextItem::setBrush(const QBrush &b)
|
|||
|
||||
void DiveTextItem::setScale(double newscale)
|
||||
{
|
||||
scale = newscale;
|
||||
if (scale != newscale) {
|
||||
scale = newscale;
|
||||
updateText();
|
||||
}
|
||||
}
|
||||
|
||||
void DiveTextItem::setText(const QString &t)
|
||||
{
|
||||
internalText = t;
|
||||
updateText();
|
||||
if (internalText != t) {
|
||||
internalText = t;
|
||||
updateText();
|
||||
}
|
||||
}
|
||||
|
||||
const QString &DiveTextItem::text()
|
||||
|
|
Loading…
Reference in a new issue