fix window resizing consistency
This commit is contained in:
parent
c81dedd9a1
commit
cb3276493d
|
@ -145,11 +145,15 @@ func (w *Window) Destroy() {
|
||||||
// Update swaps buffers and polls events.
|
// Update swaps buffers and polls events.
|
||||||
func (w *Window) Update() {
|
func (w *Window) Update() {
|
||||||
mainthread.Call(func() {
|
mainthread.Call(func() {
|
||||||
wi, hi := w.window.GetSize()
|
_, _, oldW, oldH := intBounds(w.bounds)
|
||||||
w.bounds = w.bounds.ResizedMin(pixel.V(float64(wi), float64(hi)))
|
newW, newH := w.window.GetSize()
|
||||||
|
w.bounds = w.bounds.ResizedMin(w.bounds.Size() + pixel.V(
|
||||||
|
float64(newW-oldW),
|
||||||
|
float64(newH-oldH),
|
||||||
|
))
|
||||||
})
|
})
|
||||||
|
|
||||||
w.canvas.SetBounds(w.Bounds())
|
w.canvas.SetBounds(w.bounds)
|
||||||
|
|
||||||
mainthread.Call(func() {
|
mainthread.Call(func() {
|
||||||
w.begin()
|
w.begin()
|
||||||
|
|
Loading…
Reference in New Issue