File tree Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Expand file tree Collapse file tree 1 file changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -21,21 +21,21 @@ export function optimizeTop<T extends { index: number; x: number; y: number }>(
2121 ) {
2222 currentIndex -- ;
2323 } else if (
24- y [ currentIndex + 1 ] >= y [ currentIndex ] &&
25- y [ currentIndex + 1 ] >= y [ currentIndex + 2 ]
26- ) {
27- currentIndex ++ ;
28- } else if (
29- y [ currentIndex - 2 ] >= y [ currentIndex - 3 ] &&
30- y [ currentIndex - 2 ] >= y [ currentIndex - 1 ]
31- ) {
32- currentIndex -= 2 ;
33- } else if (
34- y [ currentIndex + 2 ] >= y [ currentIndex + 1 ] &&
35- y [ currentIndex + 2 ] >= y [ currentIndex + 3 ]
36- ) {
37- currentIndex += 2 ;
38- }
24+ y [ currentIndex + 1 ] >= y [ currentIndex ] &&
25+ y [ currentIndex + 1 ] >= y [ currentIndex + 2 ]
26+ ) {
27+ currentIndex ++ ;
28+ } else if (
29+ y [ currentIndex - 2 ] >= y [ currentIndex - 3 ] &&
30+ y [ currentIndex - 2 ] >= y [ currentIndex - 1 ]
31+ ) {
32+ currentIndex -= 2 ;
33+ } else if (
34+ y [ currentIndex + 2 ] >= y [ currentIndex + 1 ] &&
35+ y [ currentIndex + 2 ] >= y [ currentIndex + 3 ]
36+ ) {
37+ currentIndex += 2 ;
38+ }
3939 // interpolation to a sin() function
4040 if (
4141 y [ currentIndex - 1 ] > 0 &&
You can’t perform that action at this time.
0 commit comments