Origin-center grids by default; fix a type conversion; update tests#15
Open
evanfields wants to merge 3 commits intoGiovineItalia:masterfrom
Open
Origin-center grids by default; fix a type conversion; update tests#15evanfields wants to merge 3 commits intoGiovineItalia:masterfrom
evanfields wants to merge 3 commits intoGiovineItalia:masterfrom
Conversation
evanfields
commented
Nov 17, 2020
| h_best = neighbor | ||
| end | ||
| end | ||
| h_best |
Author
There was a problem hiding this comment.
As far as I can tell, this section is no longer necessary with center's default offset at zero, not 1. The redblobgames references doesn't describe this neighbor check code. Seems like this latter loop was previously necessary because all hexagons were shifted by (-1,-1) in Cartesian space, so the shifted hexagon that contains a Cartesian point might not be the unshifted hexagon that contains that point.
With this shift behavior removed, nearest_cubic_hexagon is already returning the correct (0-centered) hexagon for the input point.
Author
|
@bjarthur apologies for the pestering tag but looks like you have merge privileges here and this would fix the downstream Gadfly bug. Let me know if you'd like any changes! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
xandyoffset forcenterto be 0, not 1. This means that the zero index hexagon (e.g.HexagonCubic(0, 0, 0)) will be centered at the xy origin. This should fix both inconsistency in cube_round #13 and hexbin misalignment Gadfly.jl#1497 .compare to Amit Patel's reference:
i.e. the
-q-rterm should become the cubicy(second argument), but current master puts this term in cubicz.