Changeset 602 in josm for trunk


Ignore:
Timestamp:
2008-04-12T11:21:26+02:00 (16 years ago)
Author:
ramack
Message:
  • fix disappearing of gpx, when no draw.rawgps.max-line-length is set, reported by ael and Kai Stian Olstad, thanks for your help.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/layer/GpxLayer.java

    r598 r602  
    320320                                        if (lines && old != null) {
    321321                                               
    322                                                 // break out if a maxLineLength is set and the line is longer.
    323                                             if (maxLineLength > -1){
    324                                                 if (trkPnt.latlon.distance(oldWp.latlon) < maxLineLength){
    325                                                     g.drawLine(old.x, old.y, screen.x, screen.y);
    326 
    327                                                     if (direction) {
    328                                                         double t = Math.atan2(screen.y-old.y, screen.x-old.x) + Math.PI;
    329                                                         g.drawLine(screen.x,screen.y, (int)(screen.x + 10*Math.cos(t-PHI)), (int)(screen.y + 10*Math.sin(t-PHI)));
    330                                                         g.drawLine(screen.x,screen.y, (int)(screen.x + 10*Math.cos(t+PHI)), (int)(screen.y + 10*Math.sin(t+PHI)));
    331                                                     }
    332                                                 }else{
    333                                                     g.drawRect(screen.x, screen.y, 0, 0);
     322                                            // draw line, if no maxLineLength is set or the line is shorter.
     323                                            if (maxLineLength == -1 || trkPnt.latlon.distance(oldWp.latlon) <= maxLineLength){
     324                                                g.drawLine(old.x, old.y, screen.x, screen.y);
     325
     326                                                if (direction) {
     327                                                    double t = Math.atan2(screen.y-old.y, screen.x-old.x) + Math.PI;
     328                                                    g.drawLine(screen.x,screen.y, (int)(screen.x + 10*Math.cos(t-PHI)), (int)(screen.y + 10*Math.sin(t-PHI)));
     329                                                    g.drawLine(screen.x,screen.y, (int)(screen.x + 10*Math.cos(t+PHI)), (int)(screen.y + 10*Math.sin(t+PHI)));
    334330                                                }
     331                                            }else{
     332                                                g.drawRect(screen.x, screen.y, 0, 0);
    335333                                            }
    336334                                               
Note: See TracChangeset for help on using the changeset viewer.