@@ -673,6 +673,7 @@ protected PathData getCurrentPathData() {
673673
674674 protected String pathType = DEFAULT_PATH_TYPE ;
675675 protected boolean followTerrain ; // true if altitude mode indicates terrain following
676+ protected double offset = 0 ; // offset to use in clamp to ground mode
676677 protected boolean extrude ;
677678 protected double terrainConformance = DEFAULT_TERRAIN_CONFORMANCE ;
678679 protected int numSubsegments = DEFAULT_NUM_SUBSEGMENTS ;
@@ -1608,7 +1609,7 @@ protected void computePath(DrawContext dc, List<Position> positions, PathData pa
16081609 FloatBuffer path = pathData .renderedPath ;
16091610
16101611 if (this .getAltitudeMode () == WorldWind .CLAMP_TO_GROUND || dc .is2DGlobe ()) {
1611- path = this .computePointsRelativeToTerrain (dc , positions , 0d , path , pathData );
1612+ path = this .computePointsRelativeToTerrain (dc , positions , offset , path , pathData );
16121613 } else if (this .getAltitudeMode () == WorldWind .RELATIVE_TO_GROUND ) {
16131614 path = this .computePointsRelativeToTerrain (dc , positions , null , path , pathData );
16141615 } else {
@@ -2588,11 +2589,8 @@ public void setLineWidth(double lineWidth) {
25882589 * @param offset the path offset in meters.
25892590 */
25902591 public void setOffset (double offset ) {
2591- ArrayList <Position > newPositions = new ArrayList <>();
2592- for (Position p : this .positions ) {
2593- newPositions .add (new Position (p , offset ));
2594- }
2595- this .setPositions (newPositions );
2592+ this .offset =offset ;
2593+ this .reset ();
25962594 }
25972595
25982596 /**
0 commit comments