-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added centerAnchor prop on Flex, which centers it on position
With centerAnchor={true} Flex starts behaving like a usual threejs element - it centers itself on a position, rather than having this position as left-upper corner Besides the fact that this easier to work with (now you don't have to do this manually via `-width / 2`), the usecase is when you rotate the Flex to face the camera. If you do it without the centerAnchor with `position={[-width/2, height/2]}`, rotation will behave like the center is shifted (when in fact, it's not)
- Loading branch information
1 parent
ab622a2
commit ab4100b
Showing
2 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters