mirror of
https://github.com/irmen/prog8.git
synced 2024-09-11 00:54:31 +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 {
|
private fun optimalRefreshRate(frame: JFrame): Int {
|
||||||
var rate = frame.graphicsConfiguration.device.displayMode.refreshRate
|
var rate = frame.graphicsConfiguration.device.displayMode.refreshRate
|
||||||
if(rate==0)
|
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))
|
return max(30, min(250, rate))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user