From 15b615efe868047a9582aa6e281043149548f969 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 20 Jul 2024 12:07:17 +0200 Subject: [PATCH] [Camera UI] React on screen orientation changes to redraw the camera frame. --- .../backend/http/webapp/src/components/panels/Camera/Mixin.vue | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platypush/backend/http/webapp/src/components/panels/Camera/Mixin.vue b/platypush/backend/http/webapp/src/components/panels/Camera/Mixin.vue index 1398675985..02b48e0b63 100644 --- a/platypush/backend/http/webapp/src/components/panels/Camera/Mixin.vue +++ b/platypush/backend/http/webapp/src/components/panels/Camera/Mixin.vue @@ -185,6 +185,7 @@ export default { this.$watch(() => this.attrs.rotate, this.onSizeChanged) this.$watch(() => this.attrs.scale_x, this.onSizeChanged) this.$watch(() => this.attrs.scale_y, this.onSizeChanged) + screen.orientation.addEventListener('change', this.onSizeChanged) const onOrientationOrSizeChange = () => { this.onSizeChanged() @@ -194,6 +195,7 @@ export default { this.$nextTick(() => { this.resizeObserver = new ResizeObserver(onOrientationOrSizeChange) + this.resizeObserver.observe(document.body) this.resizeObserver.observe(this.$refs?.frameContainer?.parentElement) }) },