Skip to content

Commit

Permalink
export ProcessResized for workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
dweymouth committed Aug 7, 2024
1 parent 24df77c commit d2b0dad
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion internal/driver/glfw/window.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ func (w *window) processMoved(x, y int) {
go w.canvas.reloadScale()
}

func (w *window) processResized(width, height int) {
func (w *window) ProcessResized(width, height int) {
canvasSize := w.computeCanvasSize(width, height)
if !w.fullScreen {
w.width = scale.ToScreenCoordinate(w.canvas, canvasSize.Width)
Expand Down
2 changes: 1 addition & 1 deletion internal/driver/glfw/window_desktop.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ func (w *window) moved(_ *glfw.Window, x, y int) {
}

func (w *window) resized(_ *glfw.Window, width, height int) {
w.processResized(width, height)
w.ProcessResized(width, height)
}

func (w *window) scaled(_ *glfw.Window, x float32, y float32) {
Expand Down
4 changes: 2 additions & 2 deletions internal/driver/glfw/window_wasm.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func (w *window) moved(_ *glfw.Window, x, y int) {

func (w *window) resized(_ *glfw.Window, width, height int) {
w.canvas.scale = w.calculatedScale()
w.processResized(width, height)
w.ProcessResized(width, height)
}

func (w *window) frameSized(_ *glfw.Window, width, height int) {
Expand Down Expand Up @@ -551,7 +551,7 @@ func (w *window) create() {

width, height := win.GetSize()
w.processFrameSized(width, height)
w.processResized(width, height)
w.ProcessResized(width, height)
})
}

Expand Down
3 changes: 3 additions & 0 deletions window.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,7 @@ type Window interface {

// Clipboard returns the system clipboard
Clipboard() Clipboard

// Supersonic-specific for workaround window sizing issue on startup
ProcessResized(w, h int)
}

0 comments on commit d2b0dad

Please sign in to comment.