Yes—works now with HexaObjectGridPortrayal2D. Thanks very much for the quick fix.
Still doesn’t work in my Clojure app, to my surprise, but that’s not anyone else's problem. I’ll investigate further.
That was an interesting bug to track down -- it has nothing to do with circles, but rather it turns out that selection hadn't been copied over from the non-hexagonal grid code to the hexagonal grid code.
I've verified it works for the Sparse grid situation. I've also updated the Dense grid situation and the Object grid situation but haven't tested them. I'm committing now, tell me if it looks better.
On Dec 29, 2016, at 5:10 AM, Marshall <[log in to unmask]> wrote:
CircledPortrayal2D is working correctly for me using ObjectGridPortrayal2D but not using HexaObjectGridPortrayal2D.
With the HexaObjectGrid2D, the circle that ObjectGrid2D is supposed to produce does appear if it’s turned on always (when passing false to the constructor for the onlyCircleWhenSelected argument).
However, when onlyCircleWhenSelected is true, clicking on the underlying simple portrayal has no effect: The circle doesn’t appear (the inspector appears inspector tab with a double-click, though). If I switch to using ObjectGridPortrayal2D, the only-when-selected behavior works normally.
The problem is illustrated here: https://github.com/mars0i/masonborder/tree/master/students
The code as I’ve left it uses HexaObjectGridPortrayal2D, so if you click on the square in the middle of the display, nothing will happen in the display. However, if you delete the two instances of “Hexa” in line 16 in StudentsWithUI.java, a blue circle will appear around the square when it’s clicked.
I tried clicking all around the square, too—I thought that maybe something was out of sync in the way in which HexaObjectGridePortrayal2D shifts the displayed positions of the underlying rectangular grid. This experiment was unsuccessful.
I’ve also looked for information in the manual and the classdocs that would indicate that CircledPortrayal2D isn’t supposed to work with HexaObjectGridPortrayal2D, but haven’t found anything that suggests that it wouldn’t work.
The symptoms seem identical to those in an earlier issue with SparseGrid2D and SparseGridPortrayal2D:
In that case, the problem was in SparseGrid2D. In this case, the underlying grid is the same, though, both for the working and non-working versions: It’s an ObjectGrid2D.