8000 Colony screen behavior were not using the zoom factor. by rdubisz · Pull Request #1001 · akarnokd/open-ig · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Colony screen behavior were not using the zoom factor. #1001

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

Merged
merged 2 commits into from
Aug 27, 2017
Merged

Colony screen behavior were not using the zoom factor. #1001

merged 2 commits into from
Aug 27, 2017

Conversation

rdubisz
Copy link
Contributor
@rdubisz rdubisz commented Aug 27, 2017

pom.xml Outdated
@@ -0,0 +1,58 @@
<project>
Copy link
Owner

Choose a reason for hiding this comment

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

No POMs; this is not a library but a program with manual releases.

* @author rdubisz
* @since 0.95.210
*/
public class PlanetScreenTest {
Copy link
Owner

Choose a reason for hiding this comment

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

Unit test makes no sense for Open-IG and I've omitted them.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, I will remove it. POM was also added just to tell IDE where it can find tests sources, not to bundle the application. It's your project so I will do as you say :) Just my personal experience is that tests makes development much easier even in GUI application.

@@ -596,8 +596,7 @@ public void invoke() {
}
});
if (surface() != null) {
render.offsetX = -(int)((surface().boundingRectangle.width * render.scale - width) / 2);
render.offsetY = -(int)((surface().boundingRectangle.height * render.scale - height) / 2);
centerScreen();
Copy link
Owner

Choose a reason for hiding this comment

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

The solution was not about centering the screen when changing planets but to position the camera relatively to the same location on the new planet considering the surface area of the new one. I.e., if I'm looking at the top-left position on a planet of 33x33 and switch to a 20x20 planet, I should be looking relatively at the same location in the center of the screen.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had a bit bigger change for storing the last view position (and zoom level), but i thought to first check in the smallest code change possible that addresses the issue as the first try.

@akarnokd
Copy link
Owner

I don't know how the position could be saved between planet changes so let's see how this works out for now.

So please remove the tests and keep only the change to the screen file and the .gitignore.

@akarnokd akarnokd merged commit 45da45a into akarnokd:master Aug 27, 2017
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.

2 participants
0