Print

Print


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.

Sean

On Dec 29, 2016, at 5:10 AM, Marshall <[log in to unmask]> wrote:

> Hi-
> 
> 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:
> https://listserv.gmu.edu/cgi-bin/wa?A2=ind1108&L=MASON-INTEREST-L&D=0&1=MASON-INTEREST-L&9=A&I=-3&J=on&d=No+Match%3BMatch%3BMatches&z=4&P=5481
> 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.
> 
> Thanks!
> 
> Marshall