fix: wrap media position by length (#1410)
This commit is contained in:
parent
b0d5700be1
commit
31c484b041
2 changed files with 3 additions and 3 deletions
|
|
@ -27,7 +27,7 @@ Item {
|
|||
|
||||
property real playerProgress: {
|
||||
const active = Players.active;
|
||||
return active?.length ? active.position / active.length : 0;
|
||||
return active?.length ? (active.position % active.length) / active.length : 0;
|
||||
}
|
||||
|
||||
function lengthStr(length: int): string {
|
||||
|
|
@ -354,7 +354,7 @@ Item {
|
|||
|
||||
anchors.left: parent.left
|
||||
|
||||
text: root.lengthStr(Players.active?.position ?? -1)
|
||||
text: root.lengthStr(Players.active ? Players.active.position % Players.active.length : -1)
|
||||
color: Colours.palette.m3onSurfaceVariant
|
||||
font.pointSize: Tokens.font.size.small
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ Item {
|
|||
|
||||
property real playerProgress: {
|
||||
const active = Players.active;
|
||||
return active?.length ? active.position / active.length : 0;
|
||||
return active?.length ? (active.position % active.length) / active.length : 0;
|
||||
}
|
||||
|
||||
anchors.top: parent.top
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue