mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
profile: avoid double recalculation of tick positions
The ticks were recalculated twice per plotDive() call: 1) When updating the position of the axes in updateChangeLine() 2) After setting the bounds in plotDive() via setBounds() Remove the first instance. updateChangeLine() is called in only one place [from plotDive()] and therefore, the recalculation is always redundant. Moreover, rename the function to setPosition(), since it doesn't do any animation at all. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
b0faf2e4b1
commit
99c4741508
4 changed files with 10 additions and 19 deletions
|
@ -289,13 +289,7 @@ void DiveCartesianAxis::updateTicks(int animSpeed)
|
|||
changed = false;
|
||||
}
|
||||
|
||||
void DiveCartesianAxis::setLine(const QLineF &line)
|
||||
{
|
||||
QGraphicsLineItem::setLine(line);
|
||||
changed = true;
|
||||
}
|
||||
|
||||
void DiveCartesianAxis::animateChangeLine(const QRectF &rectIn, int animSpeed)
|
||||
void DiveCartesianAxis::setPosition(const QRectF &rectIn)
|
||||
{
|
||||
rect = rectIn;
|
||||
switch (position) {
|
||||
|
@ -310,7 +304,7 @@ void DiveCartesianAxis::animateChangeLine(const QRectF &rectIn, int animSpeed)
|
|||
setLine(QLineF(rect.bottomLeft(), rect.bottomRight()));
|
||||
break;
|
||||
}
|
||||
updateTicks(animSpeed);
|
||||
changed = true;
|
||||
}
|
||||
|
||||
double DiveCartesianAxis::Transform::to(double x) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue