1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-08-05 21:18:30 -04:00

cava: more optimizations for visualizer

related #2863

(cherry picked from commit c3fa7b2e1d)
This commit is contained in:
bbedward
2026-07-14 14:29:18 -04:00
parent b5b083305f
commit 82d5081b7d
2 changed files with 12 additions and 6 deletions
@@ -50,10 +50,15 @@ Item {
return;
const n = i => {
const x = v[i];
return x <= 0 ? 0 : x >= 100 ? 1 : Math.sqrt(x * 0.01);
const level = x <= 0 ? 0 : x >= 100 ? 1 : Math.sqrt(x * 0.01);
return Math.round(level * 32) / 32;
};
bars.bandsA = Qt.vector4d(n(0), n(1), n(2), n(3));
bars.bandsB = Qt.vector2d(n(4), n(5));
const a = Qt.vector4d(n(0), n(1), n(2), n(3));
const b = Qt.vector2d(n(4), n(5));
if (a == bars.bandsA && b == bars.bandsB)
return;
bars.bandsA = a;
bars.bandsB = b;
}
}