stuff = _forwardPoly(rawllpts, ltype, nsegs, isFilled);
- // @HACK: workaround XWindows bug. simple clip to a boundary.
- // this is ugly.
+ // @HACK: workaround XWindows bug. clip to a boundary.
if (Environment.doingXWindowsWorkaround && (scale <= XSCALE_THRESHOLD)) {
- int i, j, size = stuff.size();
- float[] xpts, ypts;
- for (i = 0; i < size; i += 2) {
- xpts = stuff.get(i);
- ypts = stuff.get(i + 1);
- for (j = 0; j < xpts.length; j++) {
- if (xpts[j] <= -XTHRESHOLD) {
- xpts[j] = -XTHRESHOLD;
- } else if (xpts[j] >= XTHRESHOLD) {
- xpts[j] = XTHRESHOLD;
- }
- if (ypts[j] <= -XTHRESHOLD) {
- ypts[j] = -XTHRESHOLD;
- } else if (ypts[j] >= XTHRESHOLD) {
- ypts[j] = XTHRESHOLD;
- }
- }
- stuff.set(i, xpts);
- stuff.set(i + 1, ypts);
- }
+ GeometryFactory gf = new GeometryFactory();
+ Geometry clip = JTS.createRectangle(gf, -XTHRESHOLD, -XTHRESHOLD, XTHRESHOLD, XTHRESHOLD);
+ JTS.clip(gf, clip, stuff);
}
return stuff;
}
-
+
/**
* Forward project a lat/lon Poly defined as decimal degree lat/lons.
*
Index: src/openmap/com/bbn/openmap/proj/coords/LatLonGCT.java
===================================================================
--- src/openmap/com/bbn/openmap/proj/coords/LatLonGCT.java (revision 2264)
+++ src/openmap/com/bbn/openmap/proj/coords/LatLonGCT.java (working copy)
@@ -44,7 +44,7 @@
}
public LatLonPoint inverse(double x, double y, LatLonPoint ret) {
- ret.setLatLon((float) y, (float) x);
+ ret.setLatLon(y, x);
return ret;
}