diff options
author | Be <be@mixxx.org> | 2021-09-30 00:01:33 -0500 |
---|---|---|
committer | Be <be@mixxx.org> | 2021-10-09 08:30:34 -0500 |
commit | 95d7af3e048ac1af8ffd2bdcabf63458c5cc09e0 (patch) | |
tree | 814402170d24c4446c547f7f89b8365de9e227b3 /res/qml/Mixxx/Controls/WaveformOverviewMarker.qml | |
parent | eb029c5873eb2cee8d1545f655b50498f384493f (diff) |
QML WaveformOverviewMarker: optimize position update
Diffstat (limited to 'res/qml/Mixxx/Controls/WaveformOverviewMarker.qml')
-rw-r--r-- | res/qml/Mixxx/Controls/WaveformOverviewMarker.qml | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/res/qml/Mixxx/Controls/WaveformOverviewMarker.qml b/res/qml/Mixxx/Controls/WaveformOverviewMarker.qml index 509614d228..4f20bc4e55 100644 --- a/res/qml/Mixxx/Controls/WaveformOverviewMarker.qml +++ b/res/qml/Mixxx/Controls/WaveformOverviewMarker.qml @@ -1,6 +1,7 @@ import Mixxx 0.1 as Mixxx import QtQuick 2.12 import QtQuick.Shapes 1.12 +import QtQuick.Window 2.12 Item { id: root @@ -42,7 +43,10 @@ Item { group: root.group key: root.key - onValueChanged: marker.x = parent.width * value + onValueChanged: { + // Math.round saves tons of CPU by avoiding redrawing for fractional pixel positions. + marker.x = Math.round(parent.width * value * Screen.devicePixelRatio) / Screen.devicePixelRatio; + } } } |