Revision 1450 branches/pilotoDWG/libraries/libFMap/src/com/iver/cit/gvsig/fmap/edition/cad/cadTools/RotateCadTool.java

View differences:

RotateCadTool.java
92 92
				w=lastPoint.getX()-firstPoint.getX();
93 93
				h=lastPoint.getY()-firstPoint.getY();
94 94
			try {
95
				for (int i = 0; i < editingSource.getGeometryCount(); i++) {
96
					if (selectedGeometries.get(i)) {
95
				for (int i = selectedGeometries.nextSetBit(0);
96
				i >= 0;
97
				i = selectedGeometries.nextSetBit(i + 1)){
97 98
						IGeometry geometry = editingSource.getGeometry(i);
98 99
						geometry.rotate(-Math.atan2(w,h)+Math.PI/2,firstPoint.getX(),firstPoint.getY());
99 100
						editingSource.modifyGeometry(i,geometry);
100
					}
101
					
101 102
				}
102 103
			} catch (DriverIOException e) {
103 104
				e.printStackTrace();
......
141 142
				w=x-firstPoint.getX();
142 143
				h=y-firstPoint.getY();
143 144
			try {
144
			for (int i = 0; i < efs.getGeometryCount(); i++) {
145
				if (selectedGeometries.get(i)) {
145
				for (int i = selectedGeometries.nextSetBit(0);
146
				i >= 0;
147
				i = selectedGeometries.nextSetBit(i + 1)){
146 148
					IGeometry geometry = efs.getGeometry(i);
147 149
					
148 150
					geometry.rotate(-Math.atan2(w,h)+Math.PI/2,firstPoint.getX(),firstPoint.getY());
......
157 159
							elShape).draw((Graphics2D) g,
158 160
									getCadToolAdapter().getMapControl().getViewPort(),
159 161
									CadTool.drawingSymbol);;
160
				}
162
				
161 163
			}
162 164
		} catch (DriverIOException e) {
163 165
			e.printStackTrace();

Also available in: Unified diff