forked from platypush/platypush
[Camera UI] React on screen orientation changes to redraw the camera frame.
This commit is contained in:
parent
6e99e87aa6
commit
15b615efe8
1 changed files with 2 additions and 0 deletions
|
@ -185,6 +185,7 @@ export default {
|
||||||
this.$watch(() => this.attrs.rotate, this.onSizeChanged)
|
this.$watch(() => this.attrs.rotate, this.onSizeChanged)
|
||||||
this.$watch(() => this.attrs.scale_x, this.onSizeChanged)
|
this.$watch(() => this.attrs.scale_x, this.onSizeChanged)
|
||||||
this.$watch(() => this.attrs.scale_y, this.onSizeChanged)
|
this.$watch(() => this.attrs.scale_y, this.onSizeChanged)
|
||||||
|
screen.orientation.addEventListener('change', this.onSizeChanged)
|
||||||
|
|
||||||
const onOrientationOrSizeChange = () => {
|
const onOrientationOrSizeChange = () => {
|
||||||
this.onSizeChanged()
|
this.onSizeChanged()
|
||||||
|
@ -194,6 +195,7 @@ export default {
|
||||||
|
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.resizeObserver = new ResizeObserver(onOrientationOrSizeChange)
|
this.resizeObserver = new ResizeObserver(onOrientationOrSizeChange)
|
||||||
|
this.resizeObserver.observe(document.body)
|
||||||
this.resizeObserver.observe(this.$refs?.frameContainer?.parentElement)
|
this.resizeObserver.observe(this.$refs?.frameContainer?.parentElement)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue