From: <aki...@us...> - 2006-12-23 21:39:05
|
Revision: 1235 http://svn.sourceforge.net/gridarta/?rev=1235&view=rev Author: akirschbaum Date: 2006-12-23 13:39:03 -0800 (Sat, 23 Dec 2006) Log Message: ----------- Repaint pickmaps with correct background color. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2006-12-23 21:16:52 UTC (rev 1234) +++ trunk/crossfire/ChangeLog 2006-12-23 21:39:03 UTC (rev 1235) @@ -1,5 +1,7 @@ 2006-12-23 Andreas Kirschbaum + * Repaint pickmaps with correct background color. + * Properly update map tile panel after changes. 2006-12-22 Andreas Kirschbaum Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-23 21:16:52 UTC (rev 1234) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2006-12-23 21:39:03 UTC (rev 1235) @@ -125,11 +125,7 @@ // initialize the tmp. graphic buffer tmpImage = new BufferedImage(32, 32, BufferedImage.TYPE_INT_ARGB); tmpGrfx = tmpImage.getGraphics(); - if (isPickmap) { - tmpGrfx.setColor(IGUIConstants.BG_COLOR); - } else { - tmpGrfx.setColor(mainControl.getMainView().getBackground()); // background color of window - } + setColor(tmpGrfx); tmpIcon = new ImageIcon(); setFocusable(true); @@ -219,12 +215,7 @@ * "screenshot"-image, false for normal drawing */ public void paintComponent(final Graphics grfx, final boolean isSnapshot) { - if (isPickmap) { - // draw greenisch background for pickmaps - grfx.setColor(IGUIConstants.BG_COLOR); - } else { - grfx.setColor(mainControl.getMainView().getBackground()); // background color of window - } + setColor(grfx); grfx.fillRect(0, 0, getWidth(), getHeight()); final Point point = new Point(); for (point.y = 0; point.y < mapGrid.getSize().getHeight(); point.y++) { @@ -463,9 +454,9 @@ public void paintTile(final Graphics grfx, final Point point) { // ---------- draw tile for rectangular view (non-iso) -------------- filter.newSquare(); + setColor(grfx); if (!mapModel.containsArchObject(point)) { if (isPickmap) { - grfx.setColor(IGUIConstants.BG_COLOR); grfx.fillRect(point.x * 32, point.y * 32, 32, 32); } else { CMainControl.getUnknownTileIcon().paintIcon(DefaultLevelRenderer.this, grfx, point.x * 32, point.y * 32); @@ -537,4 +528,18 @@ modelChanged(); } + /** + * Set the background color appropriate for pickmap/map window. + * + * @param grfx the Graphics to change + */ + private void setColor(final Graphics grfx) { + if (isPickmap) { + // draw greenisch background for pickmaps + grfx.setColor(IGUIConstants.BG_COLOR); + } else { + grfx.setColor(mainControl.getMainView().getBackground()); + } + } + } // class DefaultLevelRenderer This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |