Apel is a library that brings particle animations to the table with flexible behaviour and a clean developer interface. It promises also lots of predefined shapes & paths to help the developer on their particle scene
convertToSteps was incorrectly adding all rendering intervals and dividing by the sum of the distance. This is one way to compute it, but it ignores what the constructor provided and redistributes steps.
scheduleGetAmount was incorrectly multiplying its sum by the number of segments. This works if a single value was provided (before the constructors were changed to create a step array of the correct size and copy the value into all elements), but not if an array was provided. Now that the constructor forces an array of proper length, there is no longer a need to multiply here.
Write simple tests to verify these calculations continue to hold.
convertToSteps
was incorrectly adding all rendering intervals and dividing by the sum of the distance. This is one way to compute it, but it ignores what the constructor provided and redistributes steps.scheduleGetAmount
was incorrectly multiplying its sum by the number of segments. This works if a single value was provided (before the constructors were changed to create a step array of the correct size and copy the value into all elements), but not if an array was provided. Now that the constructor forces an array of proper length, there is no longer a need to multiply here.Write simple tests to verify these calculations continue to hold.