Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rescale view issue #2

Open
grijon opened this issue Mar 28, 2014 · 0 comments
Open

Rescale view issue #2

grijon opened this issue Mar 28, 2014 · 0 comments

Comments

@grijon
Copy link

grijon commented Mar 28, 2014

Grate work! Thanks for your control.

I have found an issue - a MeterNeedle not rescaled when main MeterView has been rescaled.

I solved with next fix.

in method drawLayer: inContext: for MeterView change

  • CGFloat endX = (1 + self.length) * centerX;
  • CGFloat endX = (1 + self.length) * fmin(centerX,centerY);

and add next method into MeterView

-(void)setFrame:(CGRect)frame
{
[super setFrame:frame];
needleLayer.bounds = CGRectMake(0.0f, 0.0f, frame.size.width, frame.size.height);
needleLayer.position = CGPointMake(needleLayer.bounds.size.width / 2.0, needleLayer.bounds.size.height / 2.0);
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant