mirror of
https://github.com/irmen/prog8.git
synced 2025-02-27 18:29:00 +00:00
refreshrate default value
This commit is contained in:
parent
7d2bf892b1
commit
4c1bb18956
@ -45,7 +45,9 @@ class GraphicsWindow(val pixelWidth: Int, val pixelHeight: Int, val pixelScaling
|
||||
private fun optimalRefreshRate(frame: JFrame): Int {
|
||||
var rate = frame.graphicsConfiguration.device.displayMode.refreshRate
|
||||
if(rate==0)
|
||||
rate = GraphicsEnvironment.getLocalGraphicsEnvironment().screenDevices.map { it.displayMode.refreshRate }.first { it>0 }
|
||||
rate = GraphicsEnvironment.getLocalGraphicsEnvironment().screenDevices
|
||||
.map { it.displayMode.refreshRate }
|
||||
.firstOrNull { it>0 } ?: 60
|
||||
return max(30, min(250, rate))
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user