Setting anchorPoint on node with negative scale causes position, scale change

Originator:stephen.gazzard
Number:rdar://20077105 Date Originated:06-Mar-2015 03:46 PM
Status:Open Resolved:No
Product:iOS Product Version:8.1.3 (12B466)
Classification:Other Bug Reproducible:Always
 
Summary:
When setting the anchor point on an SKSpriteNode (and presumably other nodes as well) that has a negative scale, the node will move more than one would expect from the new anchor point value, and it will also un-flip to a positive scale

Steps to Reproduce:
Minimal spriteKit project below. the 'ExpectedBehaviour.gif' file attached is what happens when the nodes scale is 0.5, 'ActualBehaviour.gif' is what happens when the nodes scale is -0.5. 

-(void)didMoveToView:(SKView *)view {
    SKSpriteNode *sprite = [SKSpriteNode spriteNodeWithImageNamed:@"Spaceship"];
    sprite.position = CGPointMake(500, 500);
    sprite.scale = //-0.5 for broken case //0.5 for expected case
    [self addChild:sprite];
    self.ship = sprite;

}

-(void)mouseDown:(NSEvent *)theEvent {
    self.ship.anchorPoint = CGPointMake(self.ship.anchorPoint.x + 0.01f, self.ship.anchorPoint.y);
}

Expected Results:
When the node has a negative scale, I would expect it to operate just like the node in ExpectedBehaviour.gif, except mirrored

Actual Results:
Instead the node visibly flips and moves large distances that are disproportionate to the change in the anchor point

Version:
8.1.3 (12B466)

Notes:
I've noted this as an iOS issue but I am seeing the exact same outcome in the MacOS version of SpriteKit

Configuration:
iPhone 6 128GB

Attachments:
ExpectedBehaviour - https://dl.dropboxusercontent.com/s/nebzn4z5v1hh8eu/CEB7A2E7-0B17-41CB-B73B-6C58BD60A8B2-5890-000025F865CD65EF.gif?dl=0
Broken Behaviour - https://dl.dropboxusercontent.com/s/psymiho4y2wi543/34B7E358-BDA5-44FA-8F57-52DFBC665ED2-5890-00002615619AD36E.gif?dl=0

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!