Skip to content

Commit

Permalink
Fixed issue #129
Browse files Browse the repository at this point in the history
The matrix multiplication order was incorrect
  • Loading branch information
danielgindi committed Jun 11, 2015
1 parent 9b3c8b7 commit 4cbd20f
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Charts/Classes/Utils/ChartViewPortHandler.swift
Original file line number Diff line number Diff line change
Expand Up @@ -186,11 +186,10 @@ public class ChartViewPortHandler: NSObject
/// Centers the viewport around the specified position (x-index and y-value) in the chart.
public func centerViewPort(#pt: CGPoint, chart: ChartViewBase)
{
var matrix = CGAffineTransformTranslate(
_touchMatrix,
-(pt.x - offsetLeft),
-(pt.y - offsetTop)
);
let translateX = pt.x - offsetLeft;
let translateY = pt.y - offsetTop;

var matrix = CGAffineTransformConcat(_touchMatrix, CGAffineTransformMakeTranslation(-translateX, -translateY));

refresh(newMatrix: matrix, chart: chart, invalidate: false);
}
Expand Down

0 comments on commit 4cbd20f

Please sign in to comment.