Changeset 598 in josm


Ignore:
Timestamp:
Apr 7, 2008 10:18:59 PM (5 years ago)
Author:
ramack
Message:
  • solving Ticket #673: drawing short lines between gpx points now, even, if a long line ( > draw.rawgps.max-line-length) was not drawn before
File:
1 edited

Legend:

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

    r594 r598  
    321321                                                 
    322322                                                // break out if a maxLineLength is set and the line is longer. 
    323                                                 if (maxLineLength > -1)  
    324                                                         if (trkPnt.latlon.distance(oldWp.latlon) > maxLineLength) continue; 
    325                                                 g.drawLine(old.x, old.y, screen.x, screen.y); 
    326  
    327                                                 if (direction) { 
     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) { 
    328328                                                        double t = Math.atan2(screen.y-old.y, screen.x-old.x) + Math.PI; 
    329329                                                        g.drawLine(screen.x,screen.y, (int)(screen.x + 10*Math.cos(t-PHI)), (int)(screen.y + 10*Math.sin(t-PHI))); 
    330330                                                        g.drawLine(screen.x,screen.y, (int)(screen.x + 10*Math.cos(t+PHI)), (int)(screen.y + 10*Math.sin(t+PHI))); 
    331                                                 } 
     331                                                    } 
     332                                                }else{ 
     333                                                    g.drawRect(screen.x, screen.y, 0, 0); 
     334                                                } 
     335                                            } 
    332336                                                 
    333337                                        } else if (!large) { 
Note: See TracChangeset for help on using the changeset viewer.