Position buffer in center of screen
This commit is contained in:
parent
79d8891c5b
commit
6b251e6fee
@ -32,7 +32,19 @@ func (backend *Backend) handleConfigureNotify (
|
|||||||
if sizeChanged {
|
if sizeChanged {
|
||||||
configureEvent =
|
configureEvent =
|
||||||
backend.compressConfigureNotify(configureEvent)
|
backend.compressConfigureNotify(configureEvent)
|
||||||
backend.application.SetSize(backend.calculateBufferSize())
|
|
||||||
|
// resize buffer
|
||||||
|
width, height := backend.calculateBufferSize()
|
||||||
|
backend.application.SetSize(width, height)
|
||||||
|
|
||||||
|
// position buffer in the center of the screen
|
||||||
|
frameWidth := width * backend.metrics.cellWidth
|
||||||
|
frameHeight := height * backend.metrics.cellHeight
|
||||||
|
backend.metrics.paddingX =
|
||||||
|
(backend.metrics.windowWidth - frameWidth) / 2
|
||||||
|
backend.metrics.paddingY =
|
||||||
|
(backend.metrics.windowHeight - frameHeight) / 2
|
||||||
|
|
||||||
backend.channel <- stone.EventResize { }
|
backend.channel <- stone.EventResize { }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user