Skip to content

Commit

Permalink
Fix re-positioning when frame origin not (0,0).
Browse files Browse the repository at this point in the history
  • Loading branch information
nschum committed Sep 18, 2012
1 parent 477e9f1 commit 395db65
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion XYPieChart/XYPieChart.m
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,8 @@ - (void)setPieCenter:(CGPoint)pieCenter
- (void)setPieRadius:(CGFloat)pieRadius
{
_pieRadius = pieRadius;
CGRect frame = CGRectMake(_pieCenter.x-pieRadius, _pieCenter.y-pieRadius, pieRadius*2, pieRadius*2);
CGPoint origin = _pieView.frame.origin;
CGRect frame = CGRectMake(origin.x+_pieCenter.x-pieRadius, origin.y+_pieCenter.y-pieRadius, pieRadius*2, pieRadius*2);
_pieCenter = CGPointMake(frame.size.width/2, frame.size.height/2);
[_pieView setFrame:frame];
[_pieView.layer setCornerRadius:_pieRadius];
Expand Down

0 comments on commit 395db65

Please sign in to comment.