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

fabric

Package Overview
Dependencies
Maintainers
1
Versions
299
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fabric - npm Package Compare versions

Comparing version 1.1.6 to 1.1.9

4

package.json
{
"name": "fabric",
"description": "Object model for HTML5 canvas, and SVG-to-canvas parser. Backed by jsdom and node-canvas.",
"version": "1.1.6",
"version": "1.1.9",
"author": "Juriy Zaytsev <kangax@gmail.com>",

@@ -18,3 +18,3 @@ "keywords": ["canvas", "graphic", "graphics", "SVG", "node-canvas", "parser", "HTML5", "object model"],

"canvas": "1.0.x",
"jsdom": "0.5.x",
"jsdom": "0.5.6",
"xmldom": "0.1.x"

@@ -21,0 +21,0 @@ },

@@ -35,2 +35,4 @@ ### Fabric [![Build Status](https://secure.travis-ci.org/kangax/fabric.js.png?branch=master)](http://travis-ci.org/#!/kangax/fabric.js)

See [Fabric limitations in Old IE](https://github.com/kangax/fabric.js/wiki/Fabric-limitations-in-oldIE).
You can [run automated unit tests](http://fabricjs.com/test/unit/) right in the browser.

@@ -37,0 +39,0 @@

(function(){
/**
* @private
* @method iterateData
* @param {CanvasRenderingContext2D} ctx context to test
* @param {Function} fn Callback, invoked with `currentValue`, `previousValue` and `index`.
* @param {Function} fn Callback, invoked with `currentValue`, `previousValue` and `index`.
* Breaks out of the loop if callback returns `false`.

@@ -17,8 +16,7 @@ */

}
/**
* @method assertColor
* @param {CanvasRenderingContext2D} ctx context to test
* @param {String} color color in a hex value
* @return {Boolean | null} `true` if all canvas pixels are of a given color, `null` if wrong color is given
* @return {Boolean | null} `true` if all canvas pixels are of a given color, `null` if wrong color is given
* @example `assertColor(canvas._oContextContainer, 'ff5555');`

@@ -44,5 +42,4 @@ */

}
/**
* @method assertSameColor
* @param {CanvasRenderingContext2D} ctx context to test

@@ -66,2 +63,2 @@ * @return {Boolean} `true` if all canvas pixels are of the same color

this.assertSameColor = assertSameColor;
})();
})();

@@ -187,6 +187,9 @@ (function() {

// // should not throw error when no callback is given
// fabric.Image.fromObject(REFERENCE_IMG_OBJECT);
// var obj = fabric.util.object.extend(fabric.util.object.clone(REFERENCE_IMG_OBJECT), {
// src: IMG_SRC
// });
// fabric.Image.fromObject(obj);
// var image;
// fabric.Image.fromObject(REFERENCE_IMG_OBJECT, function(instance){
// fabric.Image.fromObject(obj, function(instance){
// image = instance;

@@ -271,2 +274,2 @@ // });

})();
})();

@@ -631,33 +631,63 @@ (function(){

// asyncTest('animate', function() {
// var object = new fabric.Object({ left: 20, top: 30, width: 40, height: 50, angle: 43 });
asyncTest('animate', function() {
var object = new fabric.Object({ left: 20, top: 30, width: 40, height: 50, angle: 43 });
// ok(typeof object.animate == 'function');
ok(typeof object.animate == 'function');
// object.animate('left', 40);
// ok(true, 'animate without options does not crash');
object.animate('left', 40);
ok(true, 'animate without options does not crash');
// setTimeout(function() {
setTimeout(function() {
// equal(40, Math.round(object.getLeft()));
// start();
equal(40, Math.round(object.getLeft()));
start();
// }, 1000);
// });
}, 1000);
});
// asyncTest('animate multiple properties', function() {
// var object = new fabric.Object({ left: 123, top: 124 });
asyncTest('animate multiple properties', function() {
var object = new fabric.Object({ left: 123, top: 124 });
// object.animate({ left: 223, top: 224 });
object.animate({ left: 223, top: 224 });
// setTimeout(function() {
setTimeout(function() {
// equal(223, Math.round(object.get('left')));
// equal(224, Math.round(object.get('top')));
equal(223, Math.round(object.get('left')));
equal(224, Math.round(object.get('top')));
// start();
start();
// }, 1000);
// });
}, 1000);
});
asyncTest('animate multiple properties with callback', function() {
var object = new fabric.Object({ left: 0, top: 0 });
var changedInvocations = 0;
var completeInvocations = 0;
object.animate({ left: 1, top: 1 }, {
duration: 1,
onChange: function() {
changedInvocations++;
},
onComplete: function() {
completeInvocations++;
}
});
setTimeout(function() {
equal(Math.round(object.get('left')), 1);
equal(Math.round(object.get('top')), 1);
equal(changedInvocations, 2);
equal(completeInvocations, 1);
start();
}, 1000);
});
test('observable', function() {

@@ -664,0 +694,0 @@ var object = new fabric.Object({ left: 20, top: 30, width: 40, height: 50, angle: 43 });

@@ -46,2 +46,4 @@ (function() {

equal(pattern.repeat, 'repeat');
equal(pattern.offsetX, 0);
equal(pattern.offsetY, 0);
});

@@ -61,2 +63,4 @@

equal(object.repeat, 'repeat');
equal(object.offsetX, 0);
equal(object.offsetY, 0);

@@ -79,2 +83,2 @@ var sourceExecuted;

})();
})();

@@ -121,3 +121,3 @@ (function() {

deepEqual([ 1, 0, 0, 1, -10, -20 ], polygonWithAttrs.get('transformMatrix'));
deepEqual([ 2, 0, 0, 2, -10, -20 ], polygonWithAttrs.get('transformMatrix'));

@@ -137,2 +137,2 @@ var elPolygonWithoutPoints = fabric.document.createElement('polygon');

});
})();
})();

@@ -83,6 +83,6 @@ (function() {

//var polyline = fabric.Polyline.fromElement(elPolyline);
var polyline = fabric.Polyline.fromElement(elPolyline);
ok(polyline instanceof fabric.Polyline);
//ok(polyline instanceof fabric.Polyline);
//deepEqual(REFERENCE_OBJECT, polyline.toObject());
deepEqual(polyline.toObject(), REFERENCE_OBJECT);

@@ -99,5 +99,5 @@ var elPolylineWithAttrs = fabric.document.createElement('polyline');

//var expectedPoints = [{x: 10, y: 10}, {x: 20, y: 20}, {x: 30, y: 30}, {x: 10, y: 10}];
/*
deepEqual(fabric.util.object.extend(REFERENCE_OBJECT, {
var expectedPoints = [{x: 10, y: 10}, {x: 20, y: 20}, {x: 30, y: 30}, {x: 10, y: 10}];
deepEqual(polylineWithAttrs.toObject(), fabric.util.object.extend(REFERENCE_OBJECT, {
'width': 20,

@@ -110,3 +110,3 @@ 'height': 20,

'points': expectedPoints
}), polylineWithAttrs.toObject());
}));

@@ -116,10 +116,14 @@ deepEqual([ 2, 0, 0, 2, -10, -20 ], polylineWithAttrs.get('transformMatrix'));

var elPolylineWithoutPoints = fabric.document.createElement('polyline');
/*
this.assertRaise('TypeError', function(){
var error;
try {
fabric.Polyline.fromElement(elPolylineWithoutPoints);
}, 'missing points attribute should result in error');
}
catch(err) {
error = err;
}
ok(typeof error !== 'undefined', 'missing points attribute should result in error');
equal(fabric.Polyline.fromElement(), null);
*/
});
})();
})();

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

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