Changeset 7478 in josm
- Timestamp:
- 2014-08-31T17:49:56+02:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r7477 r7478 247 247 * 248 248 * This bug has only been observed on Mac OS X, see #7841. 249 * 250 * After switch to Java 7, this test is a false positive on Mac OS X (see #10446), 251 * i.e. it returns true, but the real rendering code does not require any special 252 * handling. 253 * It hasn't been further investigated why the test reports a wrong result in 254 * this case, but the method has been changed to simply return false by default. 255 * (This can be changed with a setting in the advanced preferences.) 249 256 * 250 * @return true, if the GlyphVector double translation bug is present on 251 * this System 257 * @return false by default, but depends on the value of the advanced 258 * preference glyph-bug=false|true|auto, where auto is the automatic detection 259 * method which apparently no longer gives a useful result for Java 7. 252 260 */ 253 261 public static boolean isGlyphVectorDoubleTranslationBug() { 254 262 if (IS_GLYPH_VECTOR_DOUBLE_TRANSLATION_BUG != null) 255 263 return IS_GLYPH_VECTOR_DOUBLE_TRANSLATION_BUG; 256 String overridePref = Main.pref.get("glyph-bug", null); 257 if (overridePref != null) { 264 String overridePref = Main.pref.get("glyph-bug", "false"); 265 if ("auto".equals(overridePref)) { 266 FontRenderContext frc = new FontRenderContext(null, false, false); 267 Font font = new Font("Dialog", Font.PLAIN, 12); 268 GlyphVector gv = font.createGlyphVector(frc, "x"); 269 gv.setGlyphTransform(0, AffineTransform.getTranslateInstance(1000, 1000)); 270 Shape shape = gv.getGlyphOutline(0); 271 Main.trace("#10446: shape: "+shape.getBounds()); 272 // x is about 1000 on normal stystems and about 2000 when the bug occurs 273 int x = shape.getBounds().x; 274 IS_GLYPH_VECTOR_DOUBLE_TRANSLATION_BUG = x > 1500; 275 return IS_GLYPH_VECTOR_DOUBLE_TRANSLATION_BUG; 276 } else { 258 277 boolean override = Boolean.parseBoolean(overridePref); 259 Main.info("Override glyph vector bug: set to value "+override);260 278 IS_GLYPH_VECTOR_DOUBLE_TRANSLATION_BUG = override; 261 279 return IS_GLYPH_VECTOR_DOUBLE_TRANSLATION_BUG; 262 280 } 263 FontRenderContext frc = new FontRenderContext(null, false, false);264 Font font = new Font("Dialog", Font.PLAIN, 12);265 GlyphVector gv = font.createGlyphVector(frc, "x");266 gv.setGlyphTransform(0, AffineTransform.getTranslateInstance(1000, 1000));267 Shape shape = gv.getGlyphOutline(0);268 Main.trace("#10446: shape: "+shape.getBounds());269 // x is about 1000 on normal stystems and about 2000 when the bug occurs270 int x = shape.getBounds().x;271 IS_GLYPH_VECTOR_DOUBLE_TRANSLATION_BUG = x > 1500;272 return IS_GLYPH_VECTOR_DOUBLE_TRANSLATION_BUG;273 281 } 274 282
Note:
See TracChangeset
for help on using the changeset viewer.