I pushed past ignorance and fear of the MASON source code :-) , and think I figured out how to fix the problem--although I don’t understand it.
Comparing the drawBorder() methods in ObjectGridPortrayal2D.java and ContinuousPortrayal2D.java (which draws the border correctly), there’s a difference in one line:
d.setRect(info.draw.x, info.draw.y, info.draw.x + info.draw.width, info.draw.y + info.draw.height);
d.setRect(info.draw.x, info.draw.y, info.draw.width, info.draw.height);
Here d is a java.awt.geom.Rectangle2D.Double.
Replacing the ObjectGridPortrayal2D line with the line from ContinuousPortrayal2D causes the border to be drawn correctly using ObjectGridPortrayal2D. I don’t understand why the original version causes drawBorder to behave as it did, however.
Not sure if I should issue a pull request for this change. SparseGridPortrayal2D and ValueGridPortrayal have the same version of the d.setRect line in drawBorder() as ObjectGridPortrayal2D has. I could change those two source files, too, but I wouldn’t want to do a pull request for them without testing them, and I don’t believe I’m going to have time for that.
Thanks for asking, Stewart. It doesn’t make any difference whether I setBorder for snipe-field-portrayal, mushroom-field-portrayal, or both. In all three cases I get left and top borders that seem to extend infinitely down and right. Shrinking the scale leaves the appearance of the “borders" unchanged, although the insides of the field portryals eventually become too small to see.
I’m also exploring hexagonal portrayals, which don’t asupport setBorder, and having a border isn’t crucial in any case, but it’s kind of a nice addition if it’s available.
Can I ask, what happens if you only set the border for either the snipe or the mushroom instead of setting them both?