pmndrs / react-three-flex

💪📦 Flexbox for react-three-fiber
MIT License
1.65k stars 42 forks source link

Scaled box results in child elements collapsing on each other. #72

Open oveddan opened 2 years ago

oveddan commented 2 years ago

Given this code, tryable in this sandbox where I want to scale a box and all of it's children down:

     <Flex flexDirection="row">
        <Box flexDirection="column" scale-x={0.5} scale-y={0.5}>
          <Box>
            <mesh>
              <meshBasicMaterial color="yellow" />
              <boxBufferGeometry />
            </mesh>
          </Box>
          <Box>
            <mesh>
              <meshBasicMaterial color="red" />
              <boxBufferGeometry />
            </mesh>
          </Box>
        </Box>
      </Flex>

The resulting scene looks like:

Screen Shot 2021-10-25 at 2 34 29 PM

When I'd expect the boxes to not be collapsed on each other, but stacked vertically.

Is there a way to scale down a box properly and have its children properly aligned?

saitonakamura commented 2 years ago

That looks like a bug, but i'm not sure why this is happening, i'll take a look