Changeset 10181 in josm for trunk/src/org/openstreetmap/josm/data/osm
- Timestamp:
- 2016-05-11T04:44:00+02:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm/visitor/paint
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRenderer.java
r8616 r10181 221 221 int x = (p.x+lastP.x)/2; 222 222 int y = (p.y+lastP.y)/2; 223 path.moveTo( x-virtualNodeSize, y);224 path.lineTo( x+virtualNodeSize, y);225 path.moveTo(x, y-virtualNodeSize);226 path.lineTo(x, y+virtualNodeSize);223 path.moveTo((float) x-virtualNodeSize, y); 224 path.lineTo((float) x+virtualNodeSize, y); 225 path.moveTo(x, (float) y-virtualNodeSize); 226 path.lineTo(x, (float) y+virtualNodeSize); 227 227 } 228 228 lastP = p; -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/LineClip.java
r9243 r10181 39 39 } 40 40 return cohenSutherland(p1.x, p1.y, p2.x, p2.y, clipBounds.x, clipBounds.y, 41 clipBounds.x + clipBounds.width, clipBounds.y + clipBounds.height); 41 (long) clipBounds.x + clipBounds.width, 42 (long) clipBounds.y + clipBounds.height); 42 43 } 43 44 -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r10000 r10181 144 144 int dxNext = next.x - current.x; 145 145 int dyNext = next.y - current.y; 146 double lenNext = Math.sqrt( dxNext*dxNext +dyNext*dyNext);146 double lenNext = Math.sqrt((double) dxNext*dxNext + (double) dyNext*dyNext); 147 147 148 148 if (lenNext == 0) { … … 814 814 final double segmentLength = thisP.distance(lastP); 815 815 816 final double dx = thisP.x - lastP.x;817 final double dy = thisP.y - lastP.y;816 final double dx = (double) thisP.x - lastP.x; 817 final double dy = (double) thisP.y - lastP.y; 818 818 819 819 // pos is the position from the beginning of the current segment … … 1263 1263 1264 1264 if (lastPoint != null) { 1265 dx = p.x - lastPoint.x;1266 dy = p.y - lastPoint.y;1265 dx = (long) p.x - lastPoint.x; 1266 dy = (long) p.y - lastPoint.y; 1267 1267 double segmentLength = Math.sqrt(dx*dx + dy*dy); 1268 1268 if (segmentLength > 2*(rec.getWidth()+4)) { … … 1756 1756 // Can be optimized if it turns out to be slow. 1757 1757 for (int i = 1; i < poly.npoints; ++i) { 1758 dx = poly.xpoints[i] - poly.xpoints[i-1];1759 dy = poly.ypoints[i] - poly.ypoints[i-1];1758 dx = (long) poly.xpoints[i] - poly.xpoints[i-1]; 1759 dy = (long) poly.ypoints[i] - poly.ypoints[i-1]; 1760 1760 segLen = Math.sqrt(dx*dx + dy*dy); 1761 1761 if (totalLen > curLen + segLen) { -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java
r9243 r10181 432 432 final double sy = l * (p1.y - p2.y); 433 433 434 path.lineTo(p2.x + ( int) Math.round(cosPHI * sx - sinPHI * sy), p2.y + (int) Math.round(sinPHI * sx + cosPHI * sy));435 path.moveTo(p2.x + ( int) Math.round(cosPHI * sx + sinPHI * sy), p2.y + (int) Math.round(-sinPHI * sx + cosPHI * sy));434 path.lineTo(p2.x + (float) Math.round(cosPHI * sx - sinPHI * sy), p2.y + (float) Math.round(sinPHI * sx + cosPHI * sy)); 435 path.moveTo(p2.x + (float) Math.round(cosPHI * sx + sinPHI * sy), p2.y + (float) Math.round(-sinPHI * sx + cosPHI * sy)); 436 436 path.lineTo(p2.x, p2.y); 437 437 }
Note:
See TracChangeset
for help on using the changeset viewer.