Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the ability to calculate make the camera component bounds to behave like the old camera object #2601

Closed
Skyost opened this issue Jul 5, 2023 · 2 comments · Fixed by #2769

Comments

@Skyost
Copy link
Contributor

Skyost commented Jul 5, 2023

What could be improved

Using cameraComponent.setBounds(), the camera still renders out of bounds components. This happens because the BoundedPositionBehavior object only prevents the center of the view finder to go out of the screen.

243453810-cb836c08-3387-475c-8284-46481247c55d

I think it's nicer to not render empty space, as it was the case with the old camera object.

243454292-df51587b-aa2f-4192-8601-312891b7f2b3

Note that this is the intended behavior, as discussed in #2564.

Why should this be improved

Well, it would be nice for the camera to not render empty space.

Any risks?

No risk. I think the best way to do it would be to create a cameraComponent.calculateVisibleWorldViewfinderBounds() or something like that, so that it can be used alongside of cameraComponent.setBounds().

@spydon
Copy link
Member

spydon commented Sep 24, 2023

Here is a work around for anyone that might need it:
https://stackoverflow.com/a/77167193/789545

It shouldn't be too hard to implement that into the camera, if anyone is keen to do a PR.

@Skyost
Copy link
Contributor Author

Skyost commented Sep 24, 2023

Just opened a PR @spydon 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants