mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-02-05 15:34:28 +01:00
Revert "internal/devicescale: bug fix: glfw.Monitor.GetContentScale might return 0"
This reverts commit ca6f4fce15
.
Reason: The bug #2051 couldn't be reproduced and this fix was not needed
This commit is contained in:
parent
ca6f4fce15
commit
79474af88d
@ -35,13 +35,6 @@ func monitorAt(x, y int) *glfw.Monitor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func impl(x, y int) float64 {
|
func impl(x, y int) float64 {
|
||||||
// Keep calling GetContentScale until the returned scale is 0 (#2051).
|
sx, _ := monitorAt(x, y).GetContentScale()
|
||||||
// Retry this at most 5 times to avoid an inifinite loop.
|
return float64(sx)
|
||||||
for i := 0; i < 5; i++ {
|
|
||||||
sx, _ := monitorAt(x, y).GetContentScale()
|
|
||||||
if sx != 0 {
|
|
||||||
return float64(sx)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return 1
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user