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

fabric

Package Overview
Dependencies
Maintainers
1
Versions
304
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.2.9 to 1.2.10

test/unit/image_filters.js

5

create_build_script.js

@@ -16,2 +16,3 @@ var fs = require('fs'),

'pattern',
'shadow',
'node'

@@ -53,2 +54,6 @@ ];

execSync(command);
if (i % 100 === 0) {
console.log(i + '/' + len);
}
}

@@ -55,0 +60,0 @@

4

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

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

"dependencies": {
"canvas": "1.1.x",
"canvas": "1.0.x",
"jsdom": "0.7.x",

@@ -20,0 +20,0 @@ "xmldom": "0.1.x"

@@ -15,3 +15,3 @@ ### Fabric

- Unit tested (1700+ tests at the moment)
- Unit tested (1800+ tests at the moment)
- Modular (~60 small "classes", modules, mixins)

@@ -109,3 +109,3 @@ - Cross-browser

- **object_straightening** — Adds support for rotating an object to one of 0, 90, 180, 270, etc. depending on which is angle is closer.
- **animation** — Adds support for animation (fabric.util.animate, fabric.util.requestAnimFrame, fabric.Object#animate, fabric.Canvas#fxCenterObjectH/#fxCenterObjectV/#fxRemove)
- **animation** — Adds support for animation (`fabric.util.animate`, `fabric.util.requestAnimFrame`, `fabric.Object#animate`, `fabric.Canvas#fxCenterObjectH/#fxCenterObjectV/#fxRemove`)

@@ -112,0 +112,0 @@ Additional flags for build script are:

@@ -24,2 +24,3 @@ var testrunner = require('qunit');

'./test/unit/image.js',
'./test/unit/image_filters.js',
'./test/unit/group.js',

@@ -26,0 +27,0 @@ './test/unit/parser.js',

@@ -102,2 +102,32 @@ (function() {

test('add renderOnAddRemove disabled', function() {
var rect = makeRect(),
originalRenderOnAddition,
renderAllCount = 0;
function countRenderAll() {
renderAllCount++;
}
originalRenderOnAddition = canvas.renderOnAddRemove;
canvas.renderOnAddRemove = false;
canvas.on('after:render', countRenderAll);
ok(canvas === canvas.add(rect), 'should be chainable');
equal(renderAllCount, 0);
equal(canvas.item(0), rect);
canvas.add(makeRect(), makeRect(), makeRect());
equal(canvas.getObjects().length, 4, 'should support multiple arguments');
equal(renderAllCount, 0);
canvas.renderAll();
equal(renderAllCount, 1);
canvas.off('after:render', countRenderAll);
canvas.renderOnAddRemove = originalRenderOnAddition;
});
test('insertAt', function() {

@@ -119,2 +149,36 @@ var rect1 = makeRect(),

test('insertAt renderOnAddRemove disabled', function() {
var rect1 = makeRect(),
rect2 = makeRect(),
originalRenderOnAddition,
renderAllCount = 0;
function countRenderAll() {
renderAllCount++;
}
originalRenderOnAddition = canvas.renderOnAddRemove;
canvas.renderOnAddRemove = false;
canvas.on('after:render', countRenderAll);
canvas.add(rect1, rect2);
equal(renderAllCount, 0);
var rect = makeRect();
canvas.insertAt(rect, 1);
equal(renderAllCount, 0);
equal(canvas.item(1), rect);
canvas.insertAt(rect, 2);
equal(renderAllCount, 0);
canvas.renderAll();
equal(renderAllCount, 1);
canvas.off('after:render', countRenderAll);
canvas.renderOnAddRemove = originalRenderOnAddition;
});
test('clearContext', function() {

@@ -384,2 +448,31 @@ ok(typeof canvas.clearContext == 'function');

test('remove renderOnAddRemove disabled', function() {
var rect1 = makeRect(),
rect2 = makeRect(),
originalRenderOnAddition,
renderAllCount = 0;
function countRenderAll() {
renderAllCount++;
}
originalRenderOnAddition = canvas.renderOnAddRemove;
canvas.renderOnAddRemove = false;
canvas.on('after:render', countRenderAll);
canvas.add(rect1, rect2);
equal(renderAllCount, 0);
equal(canvas.remove(rect1), rect1, 'should return removed object');
equal(renderAllCount, 0);
equal(canvas.item(0), rect2, 'only second object should be left');
canvas.renderAll();
equal(renderAllCount, 1);
canvas.off('after:render', countRenderAll);
canvas.renderOnAddRemove = originalRenderOnAddition;
});
test('sendToBack', function() {

@@ -386,0 +479,0 @@ ok(typeof canvas.sendToBack == 'function');

@@ -148,2 +148,3 @@ (function() {

equal(image.getElement(), elImage);
equal(image._originalElement, elImage);

@@ -150,0 +151,0 @@ start();

@@ -750,2 +750,25 @@ (function(){

asyncTest('animate with abort', function() {
var object = new fabric.Object({ left: 123, top: 124 });
var context;
object.animate({ left: 223, top: 224 }, {
abort: function() {
context = this;
return true;
}
});
setTimeout(function() {
equal(123, Math.round(object.get('left')));
equal(124, Math.round(object.get('top')));
equal(context, object, 'abort should be called in context of an object');
start();
}, 100);
});
test('observable', function() {

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

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