mirror of
https://github.com/bggRGjQaUbCoE/PiliPlus.git
synced 2026-06-02 00:58:19 +08:00
fix video progress indicator
Signed-off-by: dom <githubaccount56556@proton.me>
This commit is contained in:
@@ -135,23 +135,22 @@ class RenderProgressBar extends RenderBox {
|
|||||||
|
|
||||||
final radius = Radius.circular(_radius);
|
final radius = Radius.circular(_radius);
|
||||||
final rect = Rect.fromLTWH(0, 0, size.width, size.height);
|
final rect = Rect.fromLTWH(0, 0, size.width, size.height);
|
||||||
|
final rrect = RRect.fromRectAndCorners(
|
||||||
|
rect,
|
||||||
|
bottomLeft: radius,
|
||||||
|
bottomRight: radius,
|
||||||
|
);
|
||||||
|
|
||||||
if (progress == 0) {
|
if (progress == 0) {
|
||||||
canvas.drawRRect(
|
canvas.drawRRect(rrect, paint..color = _backgroundColor);
|
||||||
.fromRectAndCorners(rect, bottomLeft: radius, bottomRight: radius),
|
|
||||||
paint..color = _backgroundColor,
|
|
||||||
);
|
|
||||||
} else if (progress == 1) {
|
} else if (progress == 1) {
|
||||||
canvas.drawRRect(
|
canvas.drawRRect(rrect, paint..color = _color);
|
||||||
.fromRectAndCorners(rect, bottomLeft: radius, bottomRight: radius),
|
|
||||||
paint..color = _color,
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
final w = size.width * progress;
|
final w = size.width * progress;
|
||||||
final left = Rect.fromLTWH(0, 0, w, size.height);
|
final left = Rect.fromLTWH(0, 0, w, size.height);
|
||||||
final right = Rect.fromLTWH(w, 0, size.width - w, size.height);
|
final right = Rect.fromLTWH(w, 0, size.width - w, size.height);
|
||||||
canvas
|
canvas
|
||||||
..clipRRect(.fromRectAndRadius(rect, radius))
|
..clipRRect(rrect)
|
||||||
..drawRect(left, paint..color = _color)
|
..drawRect(left, paint..color = _color)
|
||||||
..drawRect(right, paint..color = _backgroundColor);
|
..drawRect(right, paint..color = _backgroundColor);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user