- Timestamp:
- 2017-10-09T16:47:21+02:00 (7 years ago)
- Location:
- trunk/test
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/test/functional/org/openstreetmap/josm/gui/mappaint/MapCSSRendererTest.java
r12825 r12965 31 31 import org.junit.runners.Parameterized; 32 32 import org.junit.runners.Parameterized.Parameters; 33 import org.openstreetmap.josm.Main; 33 34 import org.openstreetmap.josm.TestUtils; 34 35 import org.openstreetmap.josm.data.Bounds; 36 import org.openstreetmap.josm.data.ProjectionBounds; 35 37 import org.openstreetmap.josm.data.osm.DataSet; 36 38 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 70 72 private TestConfig testConfig; 71 73 74 // development flag - set to true in order to update all reference images 75 private static final boolean UPDATE_ALL = false; 76 72 77 /** 73 78 * The different configurations of this test. … … 195 200 } 196 201 }; 197 nc.zoomTo(testConfig.testArea); 202 ProjectionBounds pb = new ProjectionBounds(); 203 pb.extend(Main.getProjection().latlon2eastNorth(testConfig.testArea.getMin())); 204 pb.extend(Main.getProjection().latlon2eastNorth(testConfig.testArea.getMax())); 205 double scale = (pb.maxEast - pb.minEast) / IMAGE_SIZE; 206 nc.zoomTo(pb.getCenter(), scale); 207 198 208 dataSet.allPrimitives().stream().forEach(this::loadPrimitiveStyle); 199 209 dataSet.setSelected(dataSet.allPrimitives().stream().filter(n -> n.isKeyTrue("selected")).collect(Collectors.toList())); … … 211 221 g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON); 212 222 new StyledMapRenderer(g, nc, false).render(dataSet, false, testConfig.testArea); 223 224 if (UPDATE_ALL) { 225 ImageIO.write(image, "png", new File(testConfig.getTestDirectory() + "/reference.png")); 226 return; 227 } 213 228 214 229 BufferedImage reference = testConfig.getReference();
Note:
See TracChangeset
for help on using the changeset viewer.