Made centering the buffer in the window optional
It causes jitter while resizing in floating wms
This commit is contained in:
@@ -39,13 +39,18 @@ func (backend *Backend) handleConfigureNotify (
|
||||
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
|
||||
if backend.config.Center() {
|
||||
// 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
|
||||
} else {
|
||||
backend.metrics.paddingX = backend.metrics.padding
|
||||
backend.metrics.paddingY = backend.metrics.padding
|
||||
}
|
||||
|
||||
backend.windowBoundsClean = false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user