diff --git a/ui/paint/arcs.cpp b/ui/paint/arcs.cpp index 5014cc9..22ae2a5 100644 --- a/ui/paint/arcs.cpp +++ b/ui/paint/arcs.cpp @@ -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; } diff --git a/ui/paint/arcs.h b/ui/paint/arcs.h index 9efef71..a043482 100644 --- a/ui/paint/arcs.h +++ b/ui/paint/arcs.h @@ -53,6 +53,7 @@ public: bool isFinished() const; float width() const; + float maxWidth() const; float height() const; private: