Skip to content

Instantly share code, notes, and snippets.

@ChrisMissal
Created July 22, 2013 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ChrisMissal/6056014 to your computer and use it in GitHub Desktop.
Save ChrisMissal/6056014 to your computer and use it in GitHub Desktop.
"Pixel" class that exposes ints for use on a screen, but can use doubles for calculations.
public class Pixel
{
private double _x;
private double _y;
public Pixel(double x, double y)
{
_x = x;
_y = y;
}
public int X
{
get { return Convert.ToInt32(_x); }
}
public int Y
{
get { return Convert.ToInt32(_y); }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment