Pomax / bezierjs

A nodejs and client-side library for (cubic) Bezier curve work
MIT License
1.7k stars 230 forks source link

Suspicious line in `utils.compute()` #202

Closed indiscripts closed 11 months ago

indiscripts commented 11 months ago

The compute() function of utils.js contains an assignement that seems wrong:

// . . .
if (typeof dCpts[i].z !== "undefined") {
          dCpts[i] = dCpts[i].z + (dCpts[i + 1].z - dCpts[i].z) * t;
        }
// . . .

IMHO it should be replaced by:

// . . .
if (typeof dCpts[i].z !== "undefined") {
          dCpts[i].z = dCpts[i].z + (dCpts[i + 1].z - dCpts[i].z) * t;
        }
// . . .
Pomax commented 11 months ago

Well spotted. updated in https://github.com/Pomax/bezierjs/commit/62267dd6b42e043a99974425b9821f5896e7d5ab

Pomax commented 11 months ago

Fixed in 6.1.4