mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
profile: reformat timestamp labels
The timestamp labels may change their format on zoom from "mm" to "mm:ss", depending on the zoom level. Since the animation kept old labels, this meant that one can end up with a mix of labels. Therefore, always reformat the labels. Of course, this means that the labels switch instantaneously from one format to the other. This is in conflict with the whole idea of "smooth" animation. Such a smooth animation could be realized by adding a "format" flag to the Label structure and keeping thus fading in/out labels if the format changes. Do we want that? Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
2645fa1495
commit
3ae160857d
1 changed files with 6 additions and 0 deletions
|
@ -232,6 +232,12 @@ void DiveCartesianAxis::updateLabel(Label &label, double opacityEnd, double pos)
|
|||
if (label.label) {
|
||||
label.labelPosStart = label.label->pos();
|
||||
label.labelPosEnd = labelPos(pos);
|
||||
|
||||
// For the time-axis, the format might change from "mm" to "mm:ss",
|
||||
// or vice versa. Currently, we don't animate that, i.e. it will
|
||||
// switch instantaneously.
|
||||
if (position == Position::Bottom)
|
||||
label.label->set(textForValue(label.value), textColor);
|
||||
}
|
||||
if (label.line) {
|
||||
label.lineStart = label.line->line();
|
||||
|
|
Loading…
Reference in a new issue