mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-24 10:48:53 +01:00
internal/uidriver/glfw: Bug fix: getWindowSizeLimits should return -1 when the original value was -1
Updates #1602
This commit is contained in:
parent
08c3025560
commit
18ce150495
@ -251,10 +251,21 @@ func (u *UserInterface) setRunning(running bool) {
|
||||
func (u *UserInterface) getWindowSizeLimits() (minw, minh, maxw, maxh int) {
|
||||
u.m.RLock()
|
||||
defer u.m.RUnlock()
|
||||
return int(u.toGLFWPixel(float64(u.minWindowWidthInDP))),
|
||||
int(u.toGLFWPixel(float64(u.minWindowHeightInDP))),
|
||||
int(u.toGLFWPixel(float64(u.maxWindowWidthInDP))),
|
||||
int(u.toGLFWPixel(float64(u.maxWindowHeightInDP)))
|
||||
|
||||
minw, minh, maxw, maxh = -1, -1, -1, -1
|
||||
if u.minWindowWidthInDP >= 0 {
|
||||
minw = int(u.toGLFWPixel(float64(u.minWindowWidthInDP)))
|
||||
}
|
||||
if u.minWindowHeightInDP >= 0 {
|
||||
minh = int(u.toGLFWPixel(float64(u.minWindowHeightInDP)))
|
||||
}
|
||||
if u.maxWindowWidthInDP >= 0 {
|
||||
maxw = int(u.toGLFWPixel(float64(u.maxWindowWidthInDP)))
|
||||
}
|
||||
if u.maxWindowHeightInDP >= 0 {
|
||||
maxh = int(u.toGLFWPixel(float64(u.maxWindowHeightInDP)))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (u *UserInterface) getWindowSizeLimitsInDP() (minw, minh, maxw, maxh int) {
|
||||
|
Loading…
Reference in New Issue
Block a user