Skip to content

Commit

Permalink
When rescaling a fullscreen window stay full screen
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Jan 24, 2020
1 parent 729f9f8 commit be40e3c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/driver/glfw/window.go
Original file line number Diff line number Diff line change
Expand Up @@ -1060,6 +1060,15 @@ func (w *window) RescaleContext() {

func (w *window) rescaleOnMain() {
w.fitContent()
if w.fullScreen {
w.width, w.height = w.viewport.GetSize()
scaledFull := fyne.NewSize(
internal.ScaleInt(w.canvas, w.width),
internal.ScaleInt(w.canvas, w.height))
w.canvas.Resize(scaledFull)
return
}

size := w.canvas.size.Union(w.canvas.MinSize())
newWidth, newHeight := w.screenSize(size)
w.viewport.SetSize(newWidth, newHeight)
Expand Down

0 comments on commit be40e3c

Please sign in to comment.