From: <aki...@us...> - 2006-12-23 22:08:50
|
Revision: 1238 http://svn.sourceforge.net/gridarta/?rev=1238&view=rev Author: akirschbaum Date: 2006-12-23 14:08:51 -0800 (Sat, 23 Dec 2006) Log Message: ----------- Do not delete more than one object per tile when dragging the mouse. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/CMapViewBasic.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2006-12-23 21:56:49 UTC (rev 1237) +++ trunk/crossfire/ChangeLog 2006-12-23 22:08:51 UTC (rev 1238) @@ -1,5 +1,8 @@ 2006-12-23 Andreas Kirschbaum + * Do not delete more than one object per tile when dragging the + mouse. + * Make sure inventory items in map tile panel ore indented. * Repaint pickmaps with correct background color. Modified: trunk/crossfire/src/cfeditor/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-23 21:56:49 UTC (rev 1237) +++ trunk/crossfire/src/cfeditor/CMapViewBasic.java 2006-12-23 22:08:51 UTC (rev 1238) @@ -112,6 +112,12 @@ private final MapView frame; /** + * Last processed point when deleting objects by dragging. Used to prevent + * deleting multiple objects from one tile while dragging over the tile. + */ + @NotNull private final Point lastMapLoc = new Point(); + + /** * Constructs a level view. * @param mainControl the main controller * @param mapControl the controller of this view @@ -389,6 +395,7 @@ // middle mouse button: delete arch // (I intenionally used "else" here. BUTTON2_MASK seems not to work for some systems) mapCursor.setLocation(mapLoc); + lastMapLoc.setLocation(mapLoc); deleteObject(mapLoc); } } else { @@ -459,7 +466,9 @@ // Middle Mouse Button: Arches get deleted all the way - if (temp != null) { + if (temp != null && !lastMapLoc.equals(temp)) { + lastMapLoc.setLocation(temp); + // delete the topmost arch (matching the view settings) // on that square and redraw the map GameObject tmpArch = null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |