Attempt to fix picture-elements functionality broken in 2022.11 (#14813)

fixes undefined
This commit is contained in:
smonesi 2022-12-22 12:52:15 +01:00 committed by GitHub
parent 5933c2eb8e
commit 9be6a47d88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -193,7 +193,7 @@ export class HuiImage extends LitElement {
style=${styleMap({ style=${styleMap({
paddingBottom: useRatio paddingBottom: useRatio
? `${((100 * this._ratio!.h) / this._ratio!.w).toFixed(2)}%` ? `${((100 * this._ratio!.h) / this._ratio!.w).toFixed(2)}%`
: !this._lastImageHeight : this._lastImageHeight === undefined
? "56.25%" ? "56.25%"
: undefined, : undefined,
backgroundImage: backgroundImage:
@ -206,7 +206,7 @@ export class HuiImage extends LitElement {
: undefined, : undefined,
})} })}
class="container ${classMap({ class="container ${classMap({
ratio: useRatio || !this._lastImageHeight, ratio: useRatio || this._lastImageHeight === undefined,
})}" })}"
> >
${this.cameraImage && this.cameraView === "live" ${this.cameraImage && this.cameraView === "live"