Skip to content

Commit

Permalink
Fixed cubic line "leak" on first point. (Fixes #683)
Browse files Browse the repository at this point in the history
Since lately we've done many fixes to the calculation for first/last
  points in cubic drawing - we not do not need that first "add curve".
  • Loading branch information
danielgindi committed Mar 17, 2016
1 parent a9c3c38 commit f36171c
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions Charts/Classes/Renderers/LineChartRenderer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,6 @@ public class LineChartRenderer: LineRadarChartRenderer
// let the spline start
CGPathMoveToPoint(cubicPath, &valueToPixelMatrix, CGFloat(cur.xIndex), CGFloat(cur.value) * phaseY)

prevDx = CGFloat(cur.xIndex - prev.xIndex) * intensity
prevDy = CGFloat(cur.value - prev.value) * intensity

curDx = CGFloat(next.xIndex - cur.xIndex) * intensity
curDy = CGFloat(next.value - cur.value) * intensity

// the first cubic
CGPathAddCurveToPoint(cubicPath, &valueToPixelMatrix,
CGFloat(prev.xIndex) + prevDx, (CGFloat(prev.value) + prevDy) * phaseY,
CGFloat(cur.xIndex) - curDx, (CGFloat(cur.value) - curDy) * phaseY,
CGFloat(cur.xIndex), CGFloat(cur.value) * phaseY)

for (var j = minx + 1, count = min(size, entryCount - 1); j < count; j++)
{
prevPrev = prev
Expand Down

0 comments on commit f36171c

Please sign in to comment.