hyperandroid / CAAT

Canvas Advanced Animation Toolkit
hyperandroid.github.com/CAAT
MIT License
727 stars 117 forks source link

Flag to enabled/disable coordinate clamping #25

Closed ngryman closed 12 years ago

ngryman commented 12 years ago

Hi,

I don't know if it is the right thing to do, but I need to disable clamping for some platforms (on which performance is not a big deal) because of some scale effects that have lost their smoothness.

hyperandroid commented 12 years ago

Jey Nicolas,

thanks for the pull request. There's already such feature in CAAT since in webGL it's not needed all. it's not pushed et since i'm working as well in some other CAAT areas. Your approach is correct, but since setTranform method is called a lot, i prefer the approach of repointing the prototype functions to new ones , and thus avoid the constantly evaluated if (cod) { use clamp } else { not use clamp }. Will update the repo asap so that you could test whether my solution fits your needs as well.

Thanks, -ibon

2012/1/13 Nicolas Gryman < reply@reply.github.com

Hi,

I don't know if it is the right thing to do, but I need to disable clamping for some platforms (on which performance is not a big deal) because of some scale effects that have lost their smoothness.

You can merge this Pull Request by running:

git pull https://github.com/ngryman/CAAT master

Or you can view, comment on it, or merge it online at:

https://github.com/hyperandroid/CAAT/pull/25

-- Commit Summary --

  • coordinate clamping can be enabled/disabled with CAAT.coordinateClampingEnabled flag.

-- File Changes --

M src/CAAT.js (4) M src/math/affinetransform2D.js (10) M src/model/director.js (2)

-- Patch Links --

https://github.com/hyperandroid/CAAT/pull/25.patch https://github.com/hyperandroid/CAAT/pull/25.diff


Reply to this email directly or view it on GitHub: https://github.com/hyperandroid/CAAT/pull/25

hyperandroid commented 12 years ago

Just pushed. You can call CAAT.setCoordinateClamping(false); before building you CAAT.Matrix objects. Better if you call that before building the director object. Let me know how it works for you. Regards, -ibon

ngryman commented 12 years ago

Yes, your version is much better. I will update all this on monday and give you some feedback, but I think this will be perfect :)

Thanks !

hyperandroid commented 12 years ago

Ok, will close this request then. Looking forward for you feedback.

-ibon.

ngryman commented 12 years ago

Works perfect for me. Thanks a lot :)