NGAParallaxMotion icon indicating copy to clipboard operation
NGAParallaxMotion copied to clipboard

Stop / Start effect feature

Open ghost opened this issue 12 years ago • 1 comments

Currently the parallax effect is stopped by setting the intensity at a 0.0 value. I think this should be great to add start/stop command. Moreover it solve in an elegant way the mistake describe hereafter.

Test for intensity is highly incorrect as it use equality between float value: chances are great that the condition will never be true.

if (parallaxDepth == 0.0)

In such case the usage is to use a delta value and change the test to:

if (parallaxDepth < delta)

As Objective-C is not my main language maybe there is no problem at all to use the equality test on float type. But teachers and professional experience show me this was wrong.

Finally, thank for this useful and pretty piece of code !

ghost avatar Nov 21 '13 07:11 ghost

I'll consider this, but it would help me if you could provide some test code that would show when the comparison against 0.0 would fail.

michaeljbishop avatar Mar 15 '14 11:03 michaeljbishop