diff options
author | Jan Holthuis <jholthuis@mixxx.org> | 2022-01-05 12:39:44 +0100 |
---|---|---|
committer | Jan Holthuis <jholthuis@mixxx.org> | 2022-01-11 19:53:42 +0100 |
commit | 62158fc19923e71a320668102265232da67f759d (patch) | |
tree | 3203d9bcaacada58806e11277ddc8345bdb47760 /res/qml/Library.qml | |
parent | 0bc7711524cd1e3b5b5d967a439ab95b3ace4f75 (diff) |
QML: Add positiveModulo() JS helper function
Diffstat (limited to 'res/qml/Library.qml')
-rw-r--r-- | res/qml/Library.qml | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/res/qml/Library.qml b/res/qml/Library.qml index 7b88561f25..d6589927ef 100644 --- a/res/qml/Library.qml +++ b/res/qml/Library.qml @@ -28,9 +28,7 @@ Item { if (rowCount == 0) return ; - let newIndex = currentIndex = (currentIndex + value) % rowCount; - while (newIndex < 0)newIndex += rowCount - currentIndex = newIndex; + currentIndex = Mixxx.MathUtils.positiveModulo(currentIndex + value, rowCount); } function loadSelectedTrackIntoNextAvailableDeck(play) { |