show % match, not warnings, in SWF upload tool

I think this will be much clearer about whether the warnings are a good or bad amount!
This commit is contained in:
Emi Matchu 2020-08-05 13:05:17 -07:00
parent cc61d33d58
commit d283884781

View file

@ -255,13 +255,17 @@ function ItemLayerSupportReviewStep({ imageWithAlphaUrl, numWarnings }) {
return <Box>Generating image</Box>; return <Box>Generating image</Box>;
} }
const ratioBad = numWarnings / (600 * 600);
const ratioGood = 1 - ratioBad;
return ( return (
<> <>
<Box> <Box>
<b>Step 3:</b> Does this look correct? If so, let's upload it! <b>Step 3:</b> Does this look correct? If so, let's upload it!
</Box> </Box>
<Box fontSize="sm" color="gray.500"> <Box fontSize="sm" color="gray.500">
(Generated with {numWarnings} warnings.) ({Math.floor(ratioGood * 10000) / 100}% match,{" "}
{Math.floor(ratioBad * 10000) / 100}% mismatch.)
</Box> </Box>
<Box <Box
// Checkerboard pattern: https://stackoverflow.com/a/35362074/107415 // Checkerboard pattern: https://stackoverflow.com/a/35362074/107415