Comparing version 0.1.0 to 0.1.1
{ | ||
"name": "drawable", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"description": | ||
"A way to make styling canvas elements like text and images nicer", | ||
"main": "index.js", | ||
"main": "dist/index.js", | ||
"author": "Jacob Lowe", | ||
@@ -11,12 +11,16 @@ "license": "MIT", | ||
"build": "babel src --out-dir dist", | ||
"watch": "babel src --out-dir dist --watch" | ||
"watch": "babel src --out-dir dist --watch", | ||
"test": "npm run build && ava tests/*.test.js", | ||
"prepublish": "npm run build" | ||
}, | ||
"dependencies": { | ||
"canvas": "2.0.0-aplha.4", | ||
"canvas": "2.0.0-alpha.4", | ||
"image-size": "^0.6.1" | ||
}, | ||
"devDependencies": { | ||
"ava": "^0.22.0", | ||
"babel-cli": "^6.26.0", | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0" | ||
"babel-plugin-transform-es2015-modules-commonjs": "^6.26.0", | ||
"mock-require": "^2.0.2" | ||
} | ||
} |
@@ -8,3 +8,3 @@ # Drawable | ||
``` | ||
npi i drawable --save | ||
npm i drawable --save | ||
``` | ||
@@ -17,3 +17,3 @@ | ||
const drawable = new Drawable({ width: 200, height: 200 }); | ||
const drawable = new Drawable({ width: 200, height: 200, backgroundColor: 'white' }); | ||
@@ -35,1 +35,8 @@ drawable.addFont('../font/path.ttf', 'Fake font'); | ||
``` | ||
## TODO | ||
- make api work on both client and server | ||
- solidify output methods `toBuffer` and `toDataURI` | ||
- make a public way to expose canvas element ( for appending to DOM ) | ||
- make a few adapters to work with react and ember |
@@ -13,3 +13,3 @@ import Canvas from 'canvas'; | ||
const { width, height } = this._options; | ||
this._canvas = createCanvas(width, height); | ||
this._canvas = createCanvas(width || 0, height || 0); | ||
this._context = this._canvas.getContext('2d'); | ||
@@ -42,3 +42,2 @@ } | ||
this._children = this._children.concat(elements); | ||
console.log(this._children); | ||
if (lazy || !elements.length) return Promise.resolve(); | ||
@@ -50,3 +49,3 @@ return this.draw(); | ||
registerFont(path, { family }); | ||
this.createCanvas(); // need to recreate canvas afte registering font | ||
this.createCanvas(); // need to recreate canvas after registering font | ||
} | ||
@@ -53,0 +52,0 @@ |
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
11
324
40
110210
4
+ Addedcanvas@2.0.0-alpha.4(transitive)
+ Addednan@2.22.0(transitive)
Updatedcanvas@2.0.0-alpha.4