AndroidIconAnimator icon indicating copy to clipboard operation
AndroidIconAnimator copied to clipboard

Canvas ruler sometimes breaks due to weird JS loss-of-precision

Open alexjlockwood opened this issue 9 years ago • 0 comments

For example, in line 94 and 103: https://github.com/romannurik/AndroidIconAnimator/blob/master/app/components/canvas/canvas-ruler.js#L90-L107

Sometimes the less than or equal calculations in the for loop, such as x <= (width - EXTRA_PADDING * 2), would evaluate to false because 576.5 <= 576.4999999994 or something like that, causing the last number not to show up. I got around the issue by rounding the decimal values before evaluating the expression.

alexjlockwood avatar Feb 13 '17 16:02 alexjlockwood