Using a Point object created with its constructor as the moveTo for a path fails when built for production but works when debugging.
const moveTo: Point = new Point(x, y);
path
.moveTo(moveTo)
.lineTo(moveTo.x + offsets[0].x, moveTo.y + offsets[0].y)
.lineTo(moveTo.x + offsets[1].x, moveTo.y + offsets[1].y)
.lineTo(moveTo.x + offsets[2].x, moveTo.y + offsets[2].y)
.lineTo(moveTo)
.fill('red');
If I use the code above, that path will draw just fine when built with development settings, but if I build the app for production it fails with NaN errors on the paths SVG Move step. (the error has SVG that looks like 'M Nan')
however, if I just use the X and Y coordinates, it works... the following works in production. I don't know if it's a bug or I'm doing something wrong, but the fact that it works in a dev build, but not an optimized production build makes me think it's a bug.
path
.moveTo(moveTo.x, moveTo.y)