开发者

Wandering CGAffineTransformMakeRotation

开发者 https://www.devze.com 2022-12-28 08:23 出处:网络
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

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

精彩评论

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

关注公众号