Adjutant

Workaround for symbol line style bug?

Discussion created by Adjutant on Jul 23, 2012
Latest reply on Jul 24, 2012 by Adjutant
When adding line symbols to the a GraphicTracker, the line style is not correctly displayed when the line thickness is increased.
More specifically: non-solid line styles are treated as solid line styles when the line thickness exceeds a certain threshold.

This is not a gradual threshold that slowly 'closes' the gap represented by spaces within line styles - but a sudden switch to solid.
For example : a dashed line style with width 1.12 is displayed perfectly, where a dashed line style with width 1.13 is completely solid. Note that the width difference of 0.01 is so small that it is actually visually inconceivable, but somehow triggers the threshold for this bug?

The following code demonstrates a perfectly defined dashed line symbol:
      SimpleLineSymbolClass lineSymbol = new SimpleLineSymbolClass();
      lineSymbol.Color = new RgbColorClass() { Red = 0, Green = 128, Blue = 255 };
      lineSymbol.Width = 1.12;
      lineSymbol.Style = esriSimpleLineStyle.esriSLSDash;

      PointClass centroid = new PointClass() { X = 0, Y = 0 };
      PointClass permiterPoint = new PointClass() { X = 4, Y = 0 };
      CircularArcClass circularArc = new CircularArcClass();
      circularArc.PutCoords(centroid, permiterPoint, permiterPoint, esriArcOrientation.esriArcClockwise);

      IPolyline polyline = new PolylineClass();
      ISegmentCollection segmentCollection = polyline as ISegmentCollection;
      segmentCollection.AddSegment(circularArc);

      IGraphicTrackerSymbol trackerSymbol = graphicTracker.CreateSymbol(lineSymbol as ISymbol, null);
      int graphicID = graphicTracker.Add(polyline, trackerSymbol);


but the following code (exactly the same, except for the line width), defines an incorrect completely solid line symbol:
      SimpleLineSymbolClass lineSymbol = new SimpleLineSymbolClass();
      lineSymbol.Color = new RgbColorClass() { Red = 0, Green = 128, Blue = 255 };
      lineSymbol.Width = 1.13;
      lineSymbol.Style = esriSimpleLineStyle.esriSLSDash;

      PointClass centroid = new PointClass() { X = 0, Y = 0 };
      PointClass permiterPoint = new PointClass() { X = 4, Y = 0 };
      CircularArcClass circularArc = new CircularArcClass();
      circularArc.PutCoords(centroid, permiterPoint, permiterPoint, esriArcOrientation.esriArcClockwise);

      IPolyline polyline = new PolylineClass();
      ISegmentCollection segmentCollection = polyline as ISegmentCollection;
      segmentCollection.AddSegment(circularArc);

      IGraphicTrackerSymbol trackerSymbol = graphicTracker.CreateSymbol(lineSymbol as ISymbol, null);
      int graphicID = graphicTracker.Add(polyline, trackerSymbol);


At the moment I'm clipping the line width to 1.12 to ensure that the line style is preserved - but ideally this should be a configurable value.
Any ideas?

Outcomes