Revision 2163
branches/pilotoDWG/applications/appgvSIG/src/com/iver/cit/gvsig/gui/cad/tools/ScaleCadTool.java | ||
---|---|---|
74 | 74 |
new Status("Precise punto final recta escala: ") |
75 | 75 |
}; |
76 | 76 |
private Escalar scaleStatus = new Escalar(); |
77 |
private Point2D scalePoint; |
|
77 | 78 |
private Point2D firstPoint; |
78 | 79 |
private Point2D lastPoint; |
79 | 80 |
private Point2D orr; |
... | ... | |
99 | 100 |
} else if (status == 1) { |
100 | 101 |
if (ds.length != 0) { |
101 | 102 |
firstPoint = new Point2D.Double(ds[0], ds[1]); |
103 |
scalePoint = firstPoint; |
|
102 | 104 |
} |
103 | 105 |
} else if (status == 2) { |
104 | 106 |
PluginServices.getMDIManager().setWaitCursor(); |
... | ... | |
152 | 154 |
frr = new Point2D.Double(ds[0], ds[1]); |
153 | 155 |
} else if (status == 8) { |
154 | 156 |
ore = new Point2D.Double(ds[0], ds[1]); |
157 |
firstPoint = ore; |
|
155 | 158 |
} else if (status == 9) { |
156 | 159 |
fre = new Point2D.Double(ds[0], ds[1]); |
157 | 160 |
|
... | ... | |
189 | 192 |
for (int i = 0; i < editingSource.getGeometryCount(); i++) { |
190 | 193 |
if (selectedGeometries.get(i)) { |
191 | 194 |
IGeometry geometry = editingSource.getGeometry(i); |
192 |
geometry.scale(firstPoint, scaleFactor, scaleFactor);
|
|
195 |
geometry.scale(scalePoint, scaleFactor, scaleFactor);
|
|
193 | 196 |
editingSource.modifyGeometry(i, geometry); |
194 | 197 |
} |
195 | 198 |
} |
... | ... | |
244 | 247 |
double distre = ore.distance(currentPoint); |
245 | 248 |
double escalado = distre / distrr; |
246 | 249 |
|
247 |
geometry.scale(firstPoint, escalado, escalado);
|
|
250 |
geometry.scale(scalePoint, escalado, escalado);
|
|
248 | 251 |
geometry.draw((Graphics2D) g, |
249 | 252 |
getCadToolAdapter().getMapControl().getViewPort(), |
250 | 253 |
CadTool.modifySymbol); |
Also available in: Unified diff