Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

canvas-curve

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

canvas-curve - npm Package Compare versions

Comparing version 0.1.9 to 0.1.10

20

lib/canvas-curve.js

@@ -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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc