[Schmitzm-commits] r597 - branches/1.0-gt2-2.6/src/skrueger/geotools

scm-commit@wald.intevation.org scm-commit at wald.intevation.org
Tue Dec 1 14:27:17 CET 2009


Author: alfonx
Date: 2009-12-01 14:27:16 +0100 (Tue, 01 Dec 2009)
New Revision: 597

Modified:
   branches/1.0-gt2-2.6/src/skrueger/geotools/ZoomXMapPaneMouseListener.java
Log:
* A bug with panning while in zoom_in mode had slipped in recently.. now fixed

Modified: branches/1.0-gt2-2.6/src/skrueger/geotools/ZoomXMapPaneMouseListener.java
===================================================================
--- branches/1.0-gt2-2.6/src/skrueger/geotools/ZoomXMapPaneMouseListener.java	2009-11-28 02:25:08 UTC (rev 596)
+++ branches/1.0-gt2-2.6/src/skrueger/geotools/ZoomXMapPaneMouseListener.java	2009-12-01 13:27:16 UTC (rev 597)
@@ -1,6 +1,7 @@
 package skrueger.geotools;
 
 import java.awt.Color;
+import java.awt.Cursor;
 import java.awt.Graphics;
 import java.awt.Point;
 import java.awt.Rectangle;
@@ -10,6 +11,8 @@
 
 import org.apache.log4j.Logger;
 
+import schmitzm.swing.SwingUtil;
+
 import com.vividsolutions.jts.geom.Coordinate;
 import com.vividsolutions.jts.geom.Envelope;
 
@@ -69,14 +72,6 @@
 		if (!isEnabled())
 			return;
 
-		if ((xMapPane.getState() == XMapPane.PAN)
-		// || (e.getButton() == MouseEvent.BUTTON3 && xMapPane.getState() ==
-		// XMapPane.ZOOM_IN)
-		) {
-			xMapPane.performPan();
-			return;
-		}
-
 		// If this is a click, let mouseClicked handle it!
 		if ((Math.abs(startPos.x - e.getPoint().x) * Math.abs(e.getPoint().y
 				- startPos.y)) < 160) {
@@ -84,6 +79,14 @@
 			return;
 		}
 
+		
+		// Not the best check.. but works
+		if (xMapPane.getCursor() == SwingUtil.PANNING_CURSOR)
+		{
+			xMapPane.performPan();
+			return;
+		}
+
 		final Rectangle bounds = xMapPane.getBounds();
 
 		Envelope mapArea = xMapPane.getMapArea();



More information about the Schmitzm-commits mailing list