Added ability to get width of displayed arcs.
Renamed previous Arcs::width method to Arcs::maxWidth.
This commit is contained in:
parent
bda12f2bec
commit
57fc9861a7
2 changed files with 13 additions and 0 deletions
|
|
@ -150,6 +150,18 @@ void ArcsAnimation::updateArcStartTime(
|
||||||
}
|
}
|
||||||
|
|
||||||
float ArcsAnimation::width() const {
|
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()) {
|
if (_arcs.empty()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -53,6 +53,7 @@ public:
|
||||||
bool isFinished() const;
|
bool isFinished() const;
|
||||||
|
|
||||||
float width() const;
|
float width() const;
|
||||||
|
float maxWidth() const;
|
||||||
float height() const;
|
float height() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue