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] Add 2D scale factor property #52170

Merged
merged 1 commit into from
Dec 17, 2021

Conversation

Ansraer
Copy link
Contributor

@Ansraer Ansraer commented Aug 27, 2021

4.0 version of #52137. Bugsquad edit: Rebase of #21446

This can be used to make 2D elements larger or smaller, independently of the current stretch mode.
Only the disabled and canvas stretch modes support this new property.

As with the 3.x version this doesn't solve the image scaling problem (again, we would need godotengine/godot-proposals#2924). In addition, font rendering currently looks weird when the scale factor is set to anything other than. After far too much time spent debugging I can now confirm that this is NOT caused by these changes. It would appear that font oversampling is currently broken. For more information please see #47957. Looks fine as of 17/12/2021 on linux. Guess someone already fixed font oversampling.

2d-scaling-demo4.zip

Pinging @Calinou, since he wanted to port this to 4.0 himself.

@Ansraer Ansraer requested review from a team as code owners August 27, 2021 22:02
@Ansraer Ansraer changed the title [4.0] Add 2d scale factor property [4.0] Add 2D scale factor property Aug 27, 2021
@Chaosus Chaosus added this to the 4.0 milestone Aug 28, 2021
scene/main/window.cpp Outdated Show resolved Hide resolved
scene/main/window.cpp Outdated Show resolved Hide resolved
scene/main/window.cpp Outdated Show resolved Hide resolved
@mhilbrunner
Copy link
Member

This has failing CI checks.

@akien-mga
Copy link
Member

The 3.x PR has been merged, but this one still doesn't pass CI.

@Ansraer
Copy link
Contributor Author

Ansraer commented Dec 4, 2021

@akien-mga Yeah, I am really sorry about that. I have been really busy with university for the last few months right now and didn't have the time to dig deeper into the testcase that fails.
Hopefully I will have some time over the winter break between preparing for my exams. IIRC the problem is that a function that gets a screen pos from a character keeps returning (0,0) (or was it the other way around?).
I probably need to dig deeper into text rendering to figure this out. When I have the spare time I will probably also need to ping bruvzg about #47957. That bug really needs to be fixed before 4.0.

@Ansraer Ansraer force-pushed the 2d-scale-factor branch 2 times, most recently from f647479 to d496ea4 Compare December 17, 2021 14:11
@Ansraer Ansraer requested a review from a team as a code owner December 17, 2021 14:11
@Ansraer
Copy link
Contributor Author

Ansraer commented Dec 17, 2021

@akien-mga Should now pass all checks. Again, I am sorry that I didn't have time for this sooner.

scene/main/window.cpp Outdated Show resolved Hide resolved
@akien-mga akien-mga merged commit b0e9371 into godotengine:master Dec 17, 2021
@akien-mga
Copy link
Member

Thanks!

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

Successfully merging this pull request may close these issues.

5 participants