ofxFlashLite
ofxFlashLite copied to clipboard
bug-fix: ofxFlashMatrix set_y_scale had the sin positive.
problem: rotating a sprite while altering its height gave weird transformation problems. width was fine
to test
.h
ofxFlashSprite * sprite1;
...
.cpp
void testApp::setup() {
sprite1 = new ofxFlashSprite();
ofxFlashShape * s = new ofxFlashShape();
s->setRectangle(-50, -50, 100, 100);
s->setFill(true);
sprite1->addChild(s);
stage->addChild(sprite1);
}
....
void testApp::update(){
// sprite1->width(100+ ofGetFrameNum() *.001f); // this works fine
sprite1->height(100+ ofGetFrameNum() *.001f); // this gives a weird transformation on the rotation
sprite1->rotation(ofGetFrameNum()*.01f);
}
with the fix we get the expected result, a box that is growing vertically and rotates at the same time
the problem was that in set_y_scale, setC wasn't using the sin as negative.
nice find. when i have a spare minutes i'll test this with the existing examples just to make sure it doesn't alter any other behavior.