canvas-curve
Advanced tools
Comparing version 0.1.6 to 0.1.7
@@ -1043,14 +1043,12 @@ /** | ||
// before the first point (if not at the left of the canvas) | ||
if(xSeries[0] > this._controlPointRadius) { | ||
for(var x=0; x<Math.ceil(xSeries[0]); x++){ | ||
var y = ySeries[0]; | ||
// copying the inteprolated values in a buffer | ||
this._xSeriesInterpolated[x] = x / w; | ||
this._ySeriesInterpolated[x] = y / h; | ||
// adjusting y for visual purpose | ||
y = y < 0 ? 0.5 : y > h ? h - 0.5 : y; | ||
this._ctx.lineTo(x/this._screenRatio, (h - y)/this._screenRatio); | ||
} | ||
for(var x=0; x<Math.ceil(xSeries[0]); x++){ | ||
var y = ySeries[0]; | ||
// copying the inteprolated values in a buffer | ||
this._xSeriesInterpolated[x] = x / w; | ||
this._ySeriesInterpolated[x] = y / h; | ||
// adjusting y for visual purpose | ||
y = y < 0 ? 0.5 : y > h ? h - 0.5 : y; | ||
this._ctx.lineTo(x/this._screenRatio, (h - y)/this._screenRatio); | ||
} | ||
@@ -1071,15 +1069,13 @@ | ||
if(this._width - this._controlPointRadius > Math.ceil(xSeries[xSeries.length - 1])) { | ||
// after the last point (if not at the right of the canvas) | ||
for(var x=Math.ceil(xSeries[xSeries.length - 1]); x<w; x++){ | ||
var y = ySeries[ySeries.length - 1]; | ||
// after the last point (if not at the right of the canvas) | ||
for(var x=Math.ceil(xSeries[xSeries.length - 1]); x<w; x++){ | ||
var y = ySeries[ySeries.length - 1]; | ||
// copying the inteprolated values in a buffer | ||
this._xSeriesInterpolated[x] = x / w; | ||
this._ySeriesInterpolated[x] = y / h; | ||
// copying the inteprolated values in a buffer | ||
this._xSeriesInterpolated[x] = x / w; | ||
this._ySeriesInterpolated[x] = y / h; | ||
// adjusting y for visual purpose | ||
y = y < 0 ? 0.5 : y > h ? h - 0.5 : y; | ||
this._ctx.lineTo(x/this._screenRatio, (h - y)/this._screenRatio); | ||
} | ||
// adjusting y for visual purpose | ||
y = y < 0 ? 0.5 : y > h ? h - 0.5 : y; | ||
this._ctx.lineTo(x/this._screenRatio, (h - y)/this._screenRatio); | ||
} | ||
@@ -1086,0 +1082,0 @@ |
{ | ||
"name": "canvas-curve", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "A spline widget", | ||
@@ -5,0 +5,0 @@ "author": "moocher", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
101830
942