From: Mark J S. <kr...@us...> - 2008-11-07 00:52:18
|
Update of /cvsroot/rails/18xx/rails/ui/swing/hexmap In directory 23jxhf1.ch3.sourceforge.com:/tmp/cvs-serv17162/18xx/rails/ui/swing/hexmap Modified Files: GUIHex.java Log Message: When drawing Blocked Hexes for Privates, tested to be sure there are blocked entries in the list. Not all Privates Block Hexes. This Fixes the 1856 Map Drawing Issue Index: GUIHex.java =================================================================== RCS file: /cvsroot/rails/18xx/rails/ui/swing/hexmap/GUIHex.java,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** GUIHex.java 4 Jun 2008 19:00:38 -0000 1.18 --- GUIHex.java 7 Nov 2008 00:52:11 -0000 1.19 *************** *** 320,336 **** for (PrivateCompanyI p : privates) { List<MapHex> blocked = p.getBlockedHexes(); ! for (MapHex hex : blocked) { ! if (getHexModel().equals(hex)) { ! g2.drawString( ! "(" + p.getName() + ")", ! rectBound.x ! + (rectBound.width - fontMetrics.stringWidth("(" ! + p.getName() ! + ")")) ! * 1 / 2, ! rectBound.y ! + ((fontMetrics.getHeight() + rectBound.height) * 7 / 15)); ! } ! } } } --- 320,338 ---- for (PrivateCompanyI p : privates) { List<MapHex> blocked = p.getBlockedHexes(); ! if (blocked != null) { ! for (MapHex hex : blocked) { ! if (getHexModel().equals(hex)) { ! g2.drawString( ! "(" + p.getName() + ")", ! rectBound.x ! + (rectBound.width - fontMetrics.stringWidth("(" ! + p.getName() ! + ")")) ! * 1 / 2, ! rectBound.y ! + ((fontMetrics.getHeight() + rectBound.height) * 7 / 15)); ! } ! } ! } } } |