Fix previews with large source images
Oops, okay, I guess I didn't test the new preview centering stuff with 1200x1200 images, like the Usul's Damask Markings. Now, I apply a max size to the whole-ass container, and make the parent responsible for centering it.
This commit is contained in:
parent
0de5a5efff
commit
6ae22d171b
2 changed files with 5 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { Box, DarkMode } from "@chakra-ui/react";
|
import { Box, Center, DarkMode } from "@chakra-ui/react";
|
||||||
import gql from "graphql-tag";
|
import gql from "graphql-tag";
|
||||||
import { useQuery } from "@apollo/client";
|
import { useQuery } from "@apollo/client";
|
||||||
import * as Sentry from "@sentry/react";
|
import * as Sentry from "@sentry/react";
|
||||||
|
@ -37,9 +37,9 @@ function WardrobePreviewAndControls({
|
||||||
return (
|
return (
|
||||||
<Sentry.ErrorBoundary fallback={MajorErrorMessage}>
|
<Sentry.ErrorBoundary fallback={MajorErrorMessage}>
|
||||||
<TestErrorSender />
|
<TestErrorSender />
|
||||||
<Box position="absolute" top="0" bottom="0" left="0" right="0">
|
<Center position="absolute" top="0" bottom="0" left="0" right="0">
|
||||||
<DarkMode>{preview}</DarkMode>
|
<DarkMode>{preview}</DarkMode>
|
||||||
</Box>
|
</Center>
|
||||||
<Box position="absolute" top="0" bottom="0" left="0" right="0">
|
<Box position="absolute" top="0" bottom="0" left="0" right="0">
|
||||||
<OutfitControls
|
<OutfitControls
|
||||||
outfitState={outfitState}
|
outfitState={outfitState}
|
||||||
|
|
|
@ -205,6 +205,8 @@ export function OutfitLayers({
|
||||||
pos="relative"
|
pos="relative"
|
||||||
height="100%"
|
height="100%"
|
||||||
width="100%"
|
width="100%"
|
||||||
|
maxWidth="600px"
|
||||||
|
maxHeight="600px"
|
||||||
// Create a stacking context, so the z-indexed layers don't escape!
|
// Create a stacking context, so the z-indexed layers don't escape!
|
||||||
zIndex="0"
|
zIndex="0"
|
||||||
ref={containerRef}
|
ref={containerRef}
|
||||||
|
|
Loading…
Reference in a new issue