mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +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) {
|
func (u *UserInterface) getWindowSizeLimits() (minw, minh, maxw, maxh int) {
|
||||||
u.m.RLock()
|
u.m.RLock()
|
||||||
defer u.m.RUnlock()
|
defer u.m.RUnlock()
|
||||||
return int(u.toGLFWPixel(float64(u.minWindowWidthInDP))),
|
|
||||||
int(u.toGLFWPixel(float64(u.minWindowHeightInDP))),
|
minw, minh, maxw, maxh = -1, -1, -1, -1
|
||||||
int(u.toGLFWPixel(float64(u.maxWindowWidthInDP))),
|
if u.minWindowWidthInDP >= 0 {
|
||||||
int(u.toGLFWPixel(float64(u.maxWindowHeightInDP)))
|
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) {
|
func (u *UserInterface) getWindowSizeLimitsInDP() (minw, minh, maxw, maxh int) {
|
||||||
|
Loading…
Reference in New Issue
Block a user