Added ability to get width of displayed arcs.

Renamed previous Arcs::width method to Arcs::maxWidth.
This commit is contained in:
23rd 2021-01-27 04:27:26 +03:00
parent bda12f2bec
commit 57fc9861a7
2 changed files with 13 additions and 0 deletions

View file

@ -150,6 +150,18 @@ void ArcsAnimation::updateArcStartTime(
}
float ArcsAnimation::width() const {
if (_arcs.empty()) {
return 0;
}
for (const auto &arc : ranges::view::reverse(_arcs)) {
if ((arc.progress != 1.)) {
return arc.rect.x() + arc.rect.width();
}
}
return 0;
}
float ArcsAnimation::maxWidth() const {
if (_arcs.empty()) {
return 0;
}

View file

@ -53,6 +53,7 @@ public:
bool isFinished() const;
float width() const;
float maxWidth() const;
float height() const;
private: