开发者

Wandering CGAffineTransformMakeRotation

Okay this is about to make me insane -- any help would be appreciated. I have two images which are part of a timer application. One is the needle/hand and the other is a little hub which is styled to look like the needle base. I'm using a CGAffineTransformMakeRotation to rotate the needle and the base stays stationary. The problem: there is like a 1-2px 'wander' to the needle's rotation which makes it look like it's moving off center in relation to the base. I have worked the base and needle image over in PS extensively, and both are dead center pixel wise -- seriously. My method to rotate the hand:

-(IBAction) rotateSteamArrow{

 CGAffineTransform rotate = CGAff开发者_StackOverflow社区ineTransformMakeRotation( degreesSteam / 180.0 *   3.14159265);
 degreesSteam = degreesSteam + 1.5;
  if (degreesSteam <= 180) {
  [steamNeedle setTransform:rotate];
  }
  else {
   [self handleSteamTimer];
   [self toggleButton:(id)timerButton];
   [self switchSound];
  }


 }


Try playing around with the views anchorpoint until it no longer wobbles.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜