The easiest way to see this bug is to look at the 'LineAnnotation on linear axes' example (the very first one) and resize the window. Watch the 'Vertical' text and you should see that it flickers on and off as you reseize the window.
After looking at the source I think the bug is in `PathAnnotation.Render` when it calls `rc.DrawClippedLine(..., null, pts => clippedPoints = pts)`. The `pointsRendered` callback can be called multiple times with the same list. Since it's using that list directly, the final value of `clippedPoints` simply reflects the value of the `outputBuffer` from `RenderingExtensions.DrawClippedLine` which is periodically cleared and rebuilt during the `DrawClippedLine` call.
My best guess for the fix is to pass a real list (not null) for the `outputBuffer` parameter and use that instead of the `pointsRendered` callback in `PathAnnotation.Render`.
Comments: Here's a better fix recommendation for `PathAnnotation.Render`: ``` C# var clippedPoints = new List<ScreenPoint>(); ... rc.DrawClippedLine( this.screenPoints, clippingRectangle, MinimumSegmentLength * MinimumSegmentLength, this.GetSelectableColor(this.Color), this.StrokeThickness, dashArray, this.LineJoin, this.aliased, null, pts => clippedPoints.AddRange(pts)); ```
After looking at the source I think the bug is in `PathAnnotation.Render` when it calls `rc.DrawClippedLine(..., null, pts => clippedPoints = pts)`. The `pointsRendered` callback can be called multiple times with the same list. Since it's using that list directly, the final value of `clippedPoints` simply reflects the value of the `outputBuffer` from `RenderingExtensions.DrawClippedLine` which is periodically cleared and rebuilt during the `DrawClippedLine` call.
My best guess for the fix is to pass a real list (not null) for the `outputBuffer` parameter and use that instead of the `pointsRendered` callback in `PathAnnotation.Render`.
Comments: Here's a better fix recommendation for `PathAnnotation.Render`: ``` C# var clippedPoints = new List<ScreenPoint>(); ... rc.DrawClippedLine( this.screenPoints, clippingRectangle, MinimumSegmentLength * MinimumSegmentLength, this.GetSelectableColor(this.Color), this.StrokeThickness, dashArray, this.LineJoin, this.aliased, null, pts => clippedPoints.AddRange(pts)); ```