fananek / hex-grid

HexGrid library provides easy and intuitive way of working with hexagonal grids.
MIT License
45 stars 8 forks source link

Added doccomments to HexGrid properties and various structures and enumerations. Encapsulated pixelWidth and pixelHeight properties into a HexSize structure. #11

Closed mgrider closed 2 years ago

mgrider commented 2 years ago

Mostly this just includes additional doccomments, but there are two "actual" changes here:

  1. I removed pixelWidth and pixelHeight in favor of a new pixelSize.
  2. I added a new didSet to the hexSize property to call updatePixelDomensions(), because otherwise the pixel values were outdated at that time.

I didn't write any new tests, but I did update them to refer to the pixelSize property.

Note that the first change above is a breaking API change, and you'll have to update any code that relies on those properties.

mgrider commented 2 years ago

I also considered renaming hexSize to cellSize, which I find to be clearer, but I didn't want to go "too far" with this, my first PR. 😂