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

Ensure flight planner is always (partially) visible #1611

Merged

Conversation

ts826848
Copy link
Contributor

@ts826848 ts826848 commented Oct 17, 2017

Fixes #1609.

Copy link
Member

@eggrobin eggrobin left a comment

Choose a reason for hiding this comment

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

Thank you very much for the pull request; a couple of nitpicks, but this looks good.

In the future it might make sense to move some of that logic into a class used for all windows, but that would in any case be a job for a later pull request in a cleanup-oriented lunation.

const float min_width_on_screen = 50;
const float min_height_on_screen = 50;
window_rectangle_.x = UnityEngine.Mathf.Clamp(window_rectangle_.x,
min_width_on_screen - window_rectangle_.width,
Copy link
Member

Choose a reason for hiding this comment

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

We use 80 character lines, please fold.
I'm also going ask you to put the all the min_something on the same side, I find that easier to understand:

      window_rectangle_.x =
          UnityEngine.Mathf.Clamp(
              window_rectangle_.x,
              -window_rectangle_.width + min_width_on_screen,
              UnityEngine.Screen.width - min_width_on_screen);
      window_rectangle_.y =
          UnityEngine.Mathf.Clamp(
              window_rectangle_.y,
              -window_rectangle_.height + min_height_on_screen,
              UnityEngine.Screen.height - min_height_on_screen);

should be fine.

@eggrobin eggrobin added the LGTM label Oct 17, 2017
@eggrobin eggrobin merged commit 6823b9e into mockingbirdnest:master Oct 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants