canvas-curve
Advanced tools
Comparing version 0.1.9 to 0.1.10
@@ -275,8 +275,6 @@ /** | ||
*/ | ||
add( p ){ | ||
add( p, pointRadius ){ | ||
var newIndex = null; | ||
if(p.x >= this._min.x && p.x <= this._max.x && p.y >= this._min.y && p.y <= this._max.y) | ||
{ | ||
if((p.x - pointRadius) >= this._min.x && (p.x + pointRadius) <= this._max.x && (p.y - pointRadius) >= this._min.y && (p.y + pointRadius) <= this._max.y){ | ||
if( !("xLocked" in p) ) | ||
@@ -387,3 +385,3 @@ p.xLocked = false; | ||
if(index >= 0 && index < this._points.length){ | ||
if((p.x - pointRadius) >= this._min.x && (p.x + pointRadius) < this._max.x && (p.y - pointRadius) >= this._min.y && (p.y + pointRadius) < this._max.y){ | ||
if((p.x - pointRadius) >= this._min.x && (p.x + pointRadius) <= this._max.x && (p.y - pointRadius) >= this._min.y && (p.y + pointRadius) <= this._max.y){ | ||
@@ -910,7 +908,11 @@ if(!this._points[index].xLocked) | ||
pt.y *= this._height; | ||
pt.value = { | ||
x: Math.round(((pt.x - this._controlPointRadius) / (this._width - 2 * this._controlPointRadius)) * this._baseValue), | ||
y: Math.round(((pt.y - this._controlPointRadius) / (this._height - 2 * this._controlPointRadius)) * this._baseValue), | ||
pt.x = Math.min(Math.max(pt.x, this._controlPointRadius), this._width - this._controlPointRadius); | ||
pt.y = Math.min(Math.max(pt.y, this._controlPointRadius), this._height - this._controlPointRadius); | ||
index = this._pointCollection.add( pt, this._controlPointRadius); | ||
const point = this._pointCollection.getPoint(index); | ||
point.value = { | ||
x: Math.round(((point.x - this._controlPointRadius) / (this._width - 2 * this._controlPointRadius)) * this._baseValue), | ||
y: Math.round(((point.y - this._controlPointRadius) / (this._height - 2 * this._controlPointRadius)) * this._baseValue), | ||
}; | ||
index = this._pointCollection.add( pt ); | ||
} | ||
@@ -917,0 +919,0 @@ |
{ | ||
"name": "canvas-curve", | ||
"version": "0.1.9", | ||
"version": "0.1.10", | ||
"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
106531
972