{
GeneralPath border = new GeneralPath();
float celld2 = cellSize_ / 2.0f;
if ( s1.getRow() == s2.getRow() ) { // horizontal
GoBoardPosition leftStone;
GoBoardPosition rightStone;
if ( s1.getCol() < s2.getCol() ) {
leftStone = s1;
rightStone = s2;
}
else {
leftStone = s2;
rightStone = s1;
}
float xleft = margin_ + ((float) leftStone.getCol() - BORDER_OFFSET) * cellSize_;
float yleft = margin_ + ((float) leftStone.getRow() - BORDER_OFFSET) * cellSize_;
float xright = margin_ + ((float) rightStone.getCol() - BORDER_OFFSET) * cellSize_;
float yright = margin_ + ((float) rightStone.getRow() - BORDER_OFFSET) * cellSize_;
border.moveTo( xleft, yleft + celld2 );
border.quadTo( xleft - celld2, yleft + celld2, xleft - celld2, yleft );
border.quadTo( xleft - celld2, yleft - celld2, xleft, yleft - celld2 );
border.lineTo( xright, yright - celld2 );
border.quadTo( xright + celld2, yright - celld2, xright + celld2, yright );
border.quadTo( xright + celld2, yright + celld2, xright, yright + celld2 );
border.closePath();
}
else { // vertical
GoBoardPosition topStone;
GoBoardPosition bottomStone;
if ( s1.getRow() < s2.getRow() ) {
topStone = s1;
bottomStone = s2;
}
else {
topStone = s2;
bottomStone = s1;
}
float xtop = margin_ + ((float) topStone.getCol() - BORDER_OFFSET ) * cellSize_;
float ytop = margin_ + ((float) topStone.getRow() - BORDER_OFFSET) * cellSize_;
float xbottom = margin_ + ((float) bottomStone.getCol() - BORDER_OFFSET) * cellSize_;
float ybottom = margin_ + ((float) bottomStone.getRow() - BORDER_OFFSET) * cellSize_;
border.moveTo( xtop - celld2, ytop );
border.quadTo( xtop - celld2, ytop - celld2, xtop, ytop - celld2 );
border.quadTo( xtop + celld2, ytop - celld2, xtop + celld2, ytop );
border.lineTo( xbottom + celld2, ybottom );
border.quadTo( xbottom + celld2, ybottom + celld2, xbottom, ybottom + celld2 );