switch to camel case.

This commit is contained in:
Miroslav Šedivý 2021-06-19 21:46:18 +02:00
parent f6edb4208e
commit e22e5e42a0

View File

@ -411,14 +411,14 @@
@Watch('state.screen.size') @Watch('state.screen.size')
onResize() { onResize() {
const { width, height } = this.state.screen.size const { width, height } = this.state.screen.size
const screen_ratio = width / height const screenRatio = width / height
const { offsetWidth, offsetHeight } = this._component const { offsetWidth, offsetHeight } = this._component
const canvas_ratio = offsetWidth / offsetHeight const canvasRatio = offsetWidth / offsetHeight
// vertical centering // vertical centering
if (screen_ratio > canvas_ratio) { if (screenRatio > canvasRatio) {
const vertical = offsetWidth / screen_ratio const vertical = offsetWidth / screenRatio
this._container.style.width = `${offsetWidth}px` this._container.style.width = `${offsetWidth}px`
this._container.style.height = `${vertical}px` this._container.style.height = `${vertical}px`
this._container.style.marginTop = `${(offsetHeight - vertical) / 2}px` this._container.style.marginTop = `${(offsetHeight - vertical) / 2}px`
@ -430,8 +430,8 @@
}) })
} }
// horizontal centering // horizontal centering
else if (screen_ratio < canvas_ratio) { else if (screenRatio < canvasRatio) {
const horizontal = screen_ratio * offsetHeight const horizontal = screenRatio * offsetHeight
this._container.style.width = `${horizontal}px` this._container.style.width = `${horizontal}px`
this._container.style.height = `${offsetHeight}px` this._container.style.height = `${offsetHeight}px`
this._container.style.marginTop = `0px` this._container.style.marginTop = `0px`