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

better way of specifying particle locations for screen icons #106

Closed
pixelzoom opened this issue Jun 5, 2019 · 1 comment
Closed

better way of specifying particle locations for screen icons #106

pixelzoom opened this issue Jun 5, 2019 · 1 comment

Comments

@pixelzoom
Copy link
Contributor

pixelzoom commented Jun 5, 2019

This is a "code polishing" issue, mainly for my benefit.

I'd like to find a better (or at least more uniform) way of specifying the locations of particles for screen icons. For example, in GasPropertiesIconFactory createDiffusionScreenIcon, I currently have:

      // Particles, locations determined empirically, relative to centerX of divider, specified left to right
      const particle1Locations = [
        new Vector2( -400, 300 ), new Vector2( -600, 600 ), new Vector2( -340, 800 )
      ];
      const particle2Locations = [
        new Vector2( 400, 300 ), new Vector2( 660, 740 )
      ];

While this is in code that is unlikely to change and isn't related to anything else, it still feels a little fragile, and there was some trial-&-error ("empirically") required to arrive at the values.

@pixelzoom
Copy link
Contributor Author

Think I'm going to leave this one "as is". The documentation is clear, and I don't think there's an obviously superior way to do this that doesn't involve a lot of work. So closing, and we'll see if it comes up in code review.

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

No branches or pull requests

1 participant