views:

13

answers:

0

I have an image (see below) that I rotate using this code. Somehow I need to find out how to find at any moment where is the little bar when rotated, could someone guide me please?

alt text

float dx = locationT.x  - imgVVolume.center.x;

float dy = locationT.y  - imgVVolume.center.y;


CGFloat angleDif = 0.0f;



movedRotationAngle = atan2(dy,dx);

if (beganRotationAngle == 0.0) {
    beganRotationAngle = movedRotationAngle;
    initialTransform = imgVVolume.transform;
}
else {
    angleDif = beganRotationAngle - movedRotationAngle;
    CGAffineTransform newTrans = CGAffineTransformRotate(initialTransform, -angleDif);
    imgVVolume.transform = newTrans;
}