fix positioning of movie layers on large screens
Oops, movie canvases were drawing larger than the images, if there was more than 600px of space available! fixed!
This commit is contained in:
parent
394e8178c4
commit
7102772f63
1 changed files with 9 additions and 1 deletions
|
@ -128,9 +128,17 @@ export function OutfitLayers({
|
|||
React.useLayoutEffect(() => {
|
||||
function computeAndSaveCanvasSize() {
|
||||
setCanvasSize(
|
||||
// Follow an algorithm similar to the <img> sizing: a square that
|
||||
// covers the available space, without exceeding the natural image size
|
||||
// (which is 600px).
|
||||
//
|
||||
// TODO: Once we're entirely off PNGs, we could drop the 600
|
||||
// requirement, and let SVGs and movies scale up as far as they
|
||||
// want...
|
||||
Math.min(
|
||||
containerRef.current.offsetWidth,
|
||||
containerRef.current.offsetHeight
|
||||
containerRef.current.offsetHeight,
|
||||
600
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue