internal/glfw: Bug fix: compile error on Windows

Updates #1385
This commit is contained in:
Hajime Hoshi 2021-04-17 04:24:13 +09:00
parent 9b6ba5ed2c
commit 99b2b5c1ee
2 changed files with 10 additions and 1 deletions

View File

@ -253,6 +253,11 @@ func (w *Window) SetSizeCallback(cbfun SizeCallback) (previous SizeCallback) {
return prev
}
func (w *Window) SetSizeLimits(minw, minh, maxw, maxh int) {
glfwDLL.call("glfwSetWindowSizeLimits", w.w, uintptr(minw), uintptr(minh), uintptr(maxw), uintptr(maxh))
panicError()
}
func (w *Window) SetIcon(images []image.Image) {
gimgs := make([]glfwImage, len(images))
defer runtime.KeepAlive(gimgs)

View File

@ -649,7 +649,11 @@ func (u *UserInterface) deviceScaleFactor() float64 {
return devicescale.GetAt(cm.x, cm.y)
}
}
return devicescale.GetAt(currentMonitor(u.window).GetPos())
m := u.initMonitor
if u.window != nil {
m = currentMonitor(u.window)
}
return devicescale.GetAt(m.GetPos())
}
func init() {