Revision 13874 trunk/extensions/extRasterTools-SE/src/org/gvsig/rastertools/rasterresolution/ZoomPixelCursorListener.java

View differences:

ZoomPixelCursorListener.java
78 78
			ext = actives[0].getFullExtent();
79 79
		} catch (ReadDriverException e1) {
80 80
			NotificationManager.addError("Error al obtener el extent", e1);
81
		} catch (ExpansionFileReadException e) {
82
			NotificationManager.addError("ExpansionFileReadException", e);
83
		}
81
		} 
84 82

  
85
			ArrayList attr = ((FLyrRasterSE)actives[0]).getAttributes();
86
			int width = 0, height = 0;
87
			 for (int i=0; i<attr.size(); i++) {
83
		ArrayList attr = ((FLyrRasterSE)actives[0]).getAttributes();
84
		int width = 0, height = 0;
85
		for (int i=0; i<attr.size(); i++) {
88 86
			Object[] a = (Object []) attr.get(i);
89 87
			if (a[0].toString().equals("Width"))
90 88
				width = ((Integer)a[1]).intValue();
......
93 91
		}
94 92

  
95 93

  
96
			 if(	ext != null &&
97
				 width != 0 &&
98
			height != 0){
94
		if(	ext != null &&
95
				width != 0 &&
96
				height != 0){
99 97

  
100
					double wcOriginCenterX = pReal.getX();
101
					double wcOriginCenterY = pReal.getY();
98
			double wcOriginCenterX = pReal.getX();
99
			double wcOriginCenterY = pReal.getY();
102 100

  
103
					//Hallamos la relaci?n entre el pixel y las WC a partir de la imagen de la capa
101
			//Hallamos la relaci?n entre el pixel y las WC a partir de la imagen de la capa
104 102
			double relacionPixelWcWidth =  (ext.getMaxX() - ext.getMinX())/width;
105 103
			double relacionPixelWcHeight = (ext.getMaxY() - ext.getMinY())/height;
106 104
			//double desplazamientoX = ext.getMinX();
......
118 116
			double wcDstHeight = wcDstMaxY - wcDstMinY;
119 117

  
120 118
			ext = new Rectangle2D.Double(wcDstMinX, wcDstMinY, wcDstWidth, wcDstHeight);
121
					mapCtrl.getMapContext().getViewPort().setExtent(ext);
122
			 }
119
			mapCtrl.getMapContext().getViewPort().setExtent(ext);
120
		}
123 121
	}
124 122

  
125 123
	/**

Also available in: Unified diff