Changeset 2987 in josm


Ignore:
Timestamp:
Feb 14, 2010 8:23:18 PM (3 years ago)
Author:
bastiK
Message:

fixed #4289 - rendering goes crazy at high zoom levels,
fixed #4424 - Problems rendering long ways at higher zoom levels

Location:
trunk/src/org/openstreetmap/josm
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/Main.java

    r2876 r2987  
    155155 
    156156    /** 
     157     * Wheather or not the java vm is openjdk 
     158     * We use this to work around openjdk bugs 
     159     */ 
     160    public static boolean isOpenjdk; 
     161 
     162    /** 
    157163     * Set or clear (if passed <code>null</code>) the map. 
    158164     */ 
     
    190196    public Main() { 
    191197        main = this; 
    192         //        platform = determinePlatformHook(); 
     198        isOpenjdk = System.getProperty("java.vm.name").toUpperCase().indexOf("OPENJDK") != -1; 
    193199        platform.startupHook(); 
    194200        contentPane.add(panel, BorderLayout.CENTER); 
  • trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java

    r2921 r2987  
    5959        text.append(" MB allocated, but free)"); 
    6060        text.append("\n"); 
    61         text.append("Java version: " + System.getProperty("java.version") + ", " + System.getProperty("java.vendor") + ", " + System.getProperty("os.name")); 
     61        text.append("Java version: " + System.getProperty("java.version") + ", " + System.getProperty("java.vendor") + ", " + System.getProperty("java.vm.name")); 
     62        text.append("\n"); 
     63        text.append("Operating system: "+ System.getProperty("os.name")); 
    6264        text.append("\n\n"); 
    6365        DataSet dataset = Main.main.getCurrentDataSet(); 
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java

    r2890 r2987  
    131131 
    132132    private void drawSegment(GeneralPath path, Point p1, Point p2, boolean showDirection, boolean reversedDirection) { 
    133         if (isSegmentVisible(p1, p2)) { 
    134  
     133        boolean drawIt = false; 
     134        if (Main.isOpenjdk) { 
     135            /** 
     136             * Work around openjdk bug. It leads to drawing artefacts when zooming in a lot. (#4289, #4424) 
     137             * (It looks like int overflow when clipping.) We do custom clipping. 
     138             */ 
     139            Rectangle bounds = g.getClipBounds(); 
     140            bounds.grow(100, 100);                  // avoid arrow heads at the border 
     141            LineClip clip = new LineClip(); 
     142            drawIt = clip.cohenSutherland(p1.x, p1.y, p2.x, p2.y, bounds.x, bounds.y, bounds.x+bounds.width, bounds.y+bounds.height); 
     143            p1 = clip.getP1(); 
     144            p2 = clip.getP2(); 
     145        } else { 
     146            drawIt = isSegmentVisible(p1, p2); 
     147        } 
     148        if (drawIt) { 
    135149            /* draw segment line */ 
    136150            path.moveTo(p1.x, p1.y); 
Note: See TracChangeset for help on using the changeset viewer.