mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-21 22:05:59 +00:00
fix(hud): the strip graph redraws at most 15 times a second
This commit is contained in:
1 parent
a3c6bdfe8f
commit
cbf9cb04d1
1 file changed
+10
-1
@@ -276,9 +276,17 @@ class DroidDeckHudView(context: Context) : View(context) {
|
|||||||
seenFpsUpdates = updates
|
seenFpsUpdates = updates
|
||||||
periodDone.trySend(Unit)
|
periodDone.trySend(Unit)
|
||||||
}
|
}
|
||||||
if (graphRect != null) invalidate()
|
if (graphRect == null) return
|
||||||
|
if (stripRect != null) {
|
||||||
|
val now = SystemClock.uptimeMillis()
|
||||||
|
if (now - lastGraphDrawMs < STRIP_GRAPH_REDRAW_MS) return
|
||||||
|
lastGraphDrawMs = now
|
||||||
|
}
|
||||||
|
invalidate()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var lastGraphDrawMs = 0L
|
||||||
|
|
||||||
private fun cycleSize() {
|
private fun cycleSize() {
|
||||||
size = size.next()
|
size = size.next()
|
||||||
onSizeCycledListener?.accept(size.token)
|
onSizeCycledListener?.accept(size.token)
|
||||||
@@ -1514,6 +1522,7 @@ class DroidDeckHudView(context: Context) : View(context) {
|
|||||||
const val TAB_PAD_X_SP = 7f
|
const val TAB_PAD_X_SP = 7f
|
||||||
const val TAB_PAD_Y_SP = 5.5f
|
const val TAB_PAD_Y_SP = 5.5f
|
||||||
const val REFRESH_MS = 500L
|
const val REFRESH_MS = 500L
|
||||||
|
const val STRIP_GRAPH_REDRAW_MS = 66L
|
||||||
private const val HUE_IDLE_MS = 500L
|
private const val HUE_IDLE_MS = 500L
|
||||||
const val MIN_SCALE = 0.5f
|
const val MIN_SCALE = 0.5f
|
||||||
const val MAX_SCALE = 2f
|
const val MAX_SCALE = 2f
|
||||||
|
|||||||
Reference in new issue
Block a user