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

Fix #7950: Incorrect setup of Normal Screenshot ViewPort #7959

Merged
merged 2 commits into from Jan 26, 2020

Conversation

JMcKiern
Copy link
Contributor

As described in #7950, selecting a Normal Screenshot would sometimes incorrectly result in the "Huge Screenshot" dialog box being shown. The dialog box would present the resolution that would be used for a default zoom screenshot even though this would not match the actual screenshot's resolution.

This pr fixes #7950 by adding handling of SC_VIEWPORT (and SC_CRASHLOG for completeness) into SetupScreenshotViewport().

Note that I don't understand all the intricacies associated with ViewPorts. Currently the ScreenshotWindow::TakeScreenshot() is the only place where SetupScreenshotViewport() is used with t == SC_VIEWPORT. So, the only properties of the viewport that currently matter in this context are the width and height. I've included the others, with what I think are appropriate values, but I may have made a mistake with these.

glx22
glx22 previously requested changes Jan 25, 2020
Copy link
Contributor

@glx22 glx22 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it would be better to use switch instead of if cascade

@glx22 glx22 dismissed their stale review January 26, 2020 04:07

It's easier to read now :)

@JMcKiern
Copy link
Contributor Author

Yeah, you're right :)

@LordAro LordAro merged commit 2158e26 into OpenTTD:master Jan 26, 2020
@JMcKiern JMcKiern deleted the fix-huge-sc-warning branch January 26, 2020 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Normal screenshot mode may incorrectly show a huge screenshot warning dialog
3 participants