mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
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:
parent
a338c7180c
commit
7b960a2df4
@ -758,7 +758,10 @@ func (u *UserInterface) updateSize() {
|
|||||||
ww = v.Width
|
ww = v.Width
|
||||||
wh = v.Height
|
wh = v.Height
|
||||||
} else {
|
} 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))
|
w = u.toDeviceIndependentPixel(float64(ww))
|
||||||
h = u.toDeviceIndependentPixel(float64(wh))
|
h = u.toDeviceIndependentPixel(float64(wh))
|
||||||
|
Loading…
Reference in New Issue
Block a user