Added ability to get width of arcs with finished animation.
This commit is contained in:
parent
57fc9861a7
commit
556a5dd90b
2 changed files with 13 additions and 0 deletions
|
|
@ -161,6 +161,18 @@ float ArcsAnimation::width() const {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float ArcsAnimation::finishedWidth() const {
|
||||||
|
if (_arcs.empty()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
for (const auto &arc : ranges::view::reverse(_arcs)) {
|
||||||
|
if (arc.threshold <= _currentValue) {
|
||||||
|
return arc.rect.x() + arc.rect.width();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
float ArcsAnimation::maxWidth() const {
|
float ArcsAnimation::maxWidth() const {
|
||||||
if (_arcs.empty()) {
|
if (_arcs.empty()) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,7 @@ public:
|
||||||
|
|
||||||
float width() const;
|
float width() const;
|
||||||
float maxWidth() const;
|
float maxWidth() const;
|
||||||
|
float finishedWidth() const;
|
||||||
float height() const;
|
float height() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue