-
Notifications
You must be signed in to change notification settings - Fork 60
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
Conversation
pom.xml
Outdated
@@ -0,0 +1,58 @@ | |||
<project> |
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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. |
#978