mirror of
https://github.com/vector-im/element-call.git
synced 2026-08-17 20:39:19 +00:00
Clarify how an invalid width and height manifest
This commit is contained in:
@@ -15,7 +15,8 @@ export function autoVideoFit(
|
||||
tileAspectRatio: number,
|
||||
): "cover" | "contain" {
|
||||
if (Number.isNaN(videoAspectRatio) || Number.isNaN(tileAspectRatio)) {
|
||||
// If we have invalid sizes (e.g. width or height is 0), default to cover to avoid black bars.
|
||||
// If we have invalid sizes (e.g. useMeasure returns 0×0 on an initial render),
|
||||
// default to cover to avoid black bars.
|
||||
return "cover";
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user