Skip to content

Commit

Permalink
fix: fix webcam flip in timelapse preview (mainsail-crew#1587)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteyou authored Oct 7, 2023
1 parent a3e74aa commit 1a7aca6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/components/panels/Timelapse/TimelapseStatusPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,11 @@ import BaseMixin from '@/components/mixins/base'
import SettingsRow from '@/components/settings/SettingsRow.vue'
import Panel from '@/components/ui/Panel.vue'
import { mdiFile, mdiInformation, mdiTextBoxSearchOutline, mdiCloseThick } from '@mdi/js'
import WebcamMixin from '@/components/mixins/webcam'
@Component({
components: { Panel, SettingsRow },
})
export default class TimelapseStatusPanel extends Mixins(BaseMixin) {
export default class TimelapseStatusPanel extends Mixins(BaseMixin, WebcamMixin) {
mdiInformation = mdiInformation
mdiFile = mdiFile
mdiCloseThick = mdiCloseThick
Expand Down Expand Up @@ -351,14 +352,13 @@ export default class TimelapseStatusPanel extends Mixins(BaseMixin) {
}
get webcamStyle() {
let transforms = []
const scale = [0, 180].includes(this.camSettings.rotate) ? 1 : this.scale
this.camSettings?.flipX ? transforms.push(`scaleX(-${scale})`) : transforms.push(`scaleX(${scale})`)
this.camSettings?.flipY ? transforms.push(`scaleY(-${scale})`) : transforms.push(`scaleY(${scale})`)
if (this.camSettings.rotate !== 0) transforms.push(`rotate(${this.camSettings.rotate}deg)`)
if (transforms.length) return { transform: transforms.join(' ') }
return {}
return {
transform: this.generateTransform(
this.camSettings.flip_horizontal ?? false,
this.camSettings.flip_vertical ?? false,
this.camSettings.rotation ?? 0
),
}
}
startRender() {
Expand Down

0 comments on commit 1a7aca6

Please sign in to comment.