uidriver/glfw: Use the actual window size for the offscreen

On Windows, a specified window size might not match with the
actual window size when the size is too big. In this case, Ebiten
could not render the offscreen well and the upper side was cropped.

To avoid this, use the actual window size for the offscreen.

Fixes #1163
This commit is contained in:
Hajime Hoshi 2020-05-22 18:18:35 +09:00
parent a338c7180c
commit 7b960a2df4

View File

@ -758,7 +758,10 @@ func (u *UserInterface) updateSize() {
ww = v.Width
wh = v.Height
} else {
ww, wh = u.windowWidth, u.windowHeight
// Instead of u.windowWidth and u.windowHeight, use the actual window size here.
// On Windows, the specified size at SetSize and the actual window size might not
// match (#1163).
ww, wh = u.window.GetSize()
}
w = u.toDeviceIndependentPixel(float64(ww))
h = u.toDeviceIndependentPixel(float64(wh))