mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
profile: set text and brush of DiveTextItem concurrently
The text and the brush are the two properties of text items that change dynamically. To avoid complexities concerning redrawing, set them concurrently instead of in two separate calls. Since setting one of the properties requires a full redraw, there is no performance advantage in setting them individually. This fixes a theoretical bug: the colors of axis labels were not updated appropriately. However, it seems like value-dependent labels weren't used anyway. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
2ebe6e3684
commit
04e0d96bae
6 changed files with 18 additions and 35 deletions
|
@ -52,8 +52,7 @@ void TankItem::createBar(int startTime, int stopTime, struct gasmix gas)
|
|||
rect->setPen(QPen(QBrush(), 0.0)); // get rid of the thick line around the rectangle
|
||||
rects.push_back(rect);
|
||||
DiveTextItem *label = new DiveTextItem(dpr, 1.0, Qt::AlignBottom | Qt::AlignRight, rect);
|
||||
label->setText(gasname(gas));
|
||||
label->setBrush(Qt::black);
|
||||
label->set(gasname(gas), Qt::black);
|
||||
label->setPos(x + 1, 0);
|
||||
#ifdef SUBSURFACE_MOBILE
|
||||
label->setPos(x + 1, -2.5);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue