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

[4.0] Camera2D's preview box uses editor viewport size instead of project settings size #38316

Closed
Tracked by #37734
verdog opened this issue Apr 29, 2020 · 1 comment · Fixed by #38341 or #40302
Closed
Tracked by #37734

Comments

@verdog
Copy link
Contributor

verdog commented Apr 29, 2020

Godot version: 4.0 abf5132
OS/device including version: Manjaro Linux
Issue description:
The preview bounds for Camera2D use the aspect ratio of the editor viewport rather than the actual size of the game defined in settings.

I think this stems from using the size of the viewport that the camera is in, in places such as

Size2 screen_size = viewport->get_visible_rect().size;

and
Size2 screen_size = get_viewport_rect().size;

I was able to hack a partial quick fix by changing those lines to look up the size in the project settings instead of the viewport, but I don't know if that's the best approach. It also led to some issues with the transform, i.e. the aspect ratio of the preview box was correct but its transform was off. This might be because my hacky fix only fixed the get screen size call in the draw notification response and not in get_camera_transform (first example above)

Steps to reproduce:
bounds

@akien-mga
Copy link
Member

Reopening as #38341 was reverted.

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.

4 participants