Comparing version 0.12.4 to 0.13.0
@@ -7,6 +7,17 @@ # Change Log | ||
## [0.13.9][2016-05-14] | ||
### Changed | ||
- typescript definition in npm package | ||
- node@5.10.1, canvas@1.3.14, jsdom@8.5.0 support | ||
- `Konva.Path` will be filled when it is not closed | ||
- `Animation.start()` will not not immediate sync draw. This should improve performance a little. | ||
- Warning when node for `Tween` is not in layer yet. | ||
- `removeChildren()` remove only first level children. So it will not remove grandchildren. | ||
## [0.12.4][2016-04-19] | ||
### Changed | ||
- `batchDraw` will not do immediate `draw()` | ||
- `batchDraw` will do not immediate `draw()` | ||
@@ -13,0 +24,0 @@ ### Fixed |
{ | ||
"name": "konva", | ||
"version": "0.12.4", | ||
"version": "0.13.0", | ||
"author": "Anton Lavrenov", | ||
"files": [ | ||
"README.md", | ||
"konva.js", | ||
"konva.min.js", | ||
"src", | ||
"konva.d.ts" | ||
], | ||
"main": "konva.js", | ||
"typings": "./konva.d.ts", | ||
"scripts": { | ||
"start": "gulp", | ||
"build": "gulp build", | ||
"full-build": "gulp lint test build", | ||
@@ -14,5 +24,5 @@ "test": "gulp test" | ||
"gulp-concat": "^2.6.0", | ||
"gulp-connect": "^3.0.0", | ||
"gulp-connect": "^4.0.0", | ||
"gulp-eslint": "^2.0.0", | ||
"gulp-jscpd": "0.0.6", | ||
"gulp-jscpd": "0.0.7", | ||
"gulp-jsdoc": "^0.1.4", | ||
@@ -41,3 +51,2 @@ "gulp-mocha-phantomjs": "^0.11.0", | ||
"readmeFilename": "README.md", | ||
"main": "konva.js", | ||
"repository": { | ||
@@ -47,10 +56,3 @@ "type": "git", | ||
}, | ||
"license": "MIT", | ||
"testling": { | ||
"html": "test/runner.html", | ||
"harness": "mocha-tdd", | ||
"browsers": [ | ||
"ie/latest" | ||
] | ||
} | ||
"license": "MIT" | ||
} |
@@ -23,3 +23,3 @@ ![Konva logo](https://raw.githubusercontent.com/konvajs/konvajs.github.io/master/apple-touch-icon-180x180.png) | ||
```html | ||
<script src="https://cdn.rawgit.com/konvajs/konva/0.12.4/konva.min.js"></script> | ||
<script src="https://cdn.rawgit.com/konvajs/konva/0.13.0/konva.min.js"></script> | ||
<div id="container"></div> | ||
@@ -69,6 +69,6 @@ <script> | ||
```html | ||
<script src="https://cdn.rawgit.com/konvajs/konva/0.12.4/konva.min.js"></script> | ||
<script src="https://cdn.rawgit.com/konvajs/konva/0.13.0/konva.min.js"></script> | ||
``` | ||
You can use CDN: [https://cdn.rawgit.com/konvajs/konva/0.12.4/konva.min.js](https://cdn.rawgit.com/konvajs/konva/0.12.4/konva.min.js) | ||
You can use CDN: [https://cdn.rawgit.com/konvajs/konva/0.13.0/konva.min.js](https://cdn.rawgit.com/konvajs/konva/0.13.0/konva.min.js) | ||
@@ -86,3 +86,3 @@ ###2 Load via AMD (requirejs): | ||
```bash | ||
npm install konva | ||
npm install konva --save | ||
``` | ||
@@ -116,14 +116,14 @@ | ||
Support for node 0.12.x only for now. | ||
You have to install some deps manually to use Konva in nodejs env. | ||
We are using [node-canvas](https://github.com/LearnBoost/node-canvas) to create canvas element. | ||
We are using [node-canvas](https://github.com/Automattic/node-canvas) to create canvas element. | ||
1. Install node-canvas dependencies [https://github.com/LearnBoost/node-canvas/wiki/_pages](https://github.com/LearnBoost/node-canvas/wiki/_pages) | ||
2. `npm install canvas@1.2.x` | ||
2. `npm install jsdom@3.x` (jsdom v4 require iojs) | ||
3. `npm install konva` | ||
1. Install node-canvas dependencies [https://github.com/Automattic/node-canvas](https://github.com/Automattic/node-canvas) | ||
2. `npm install canvas --save` | ||
2. `npm install jsdom --save` | ||
3. `npm install konva --save` | ||
See file `resources/nodejs-demo.js` for example. | ||
Last tested with node@5.10.1, canvas@1.3.14, jsdom@8.5.0 | ||
@@ -130,0 +130,0 @@ #Change log |
@@ -256,4 +256,4 @@ (function(Konva) { | ||
if(Anim.animations.length) { | ||
Anim._runFrames(); | ||
requestAnimFrame(Anim._animationLoop); | ||
Anim._runFrames(); | ||
} | ||
@@ -267,3 +267,3 @@ else { | ||
this.animRunning = true; | ||
this._animationLoop(); | ||
requestAnimFrame(this._animationLoop); | ||
} | ||
@@ -270,0 +270,0 @@ }; |
@@ -72,5 +72,2 @@ (function() { | ||
child.index = 0; | ||
if (child.hasChildren()) { | ||
child.removeChildren(); | ||
} | ||
child.remove(); | ||
@@ -77,0 +74,0 @@ } |
@@ -176,2 +176,25 @@ | ||
}, | ||
_detectIE: function(ua) { | ||
var msie = ua.indexOf('msie '); | ||
if (msie > 0) { | ||
// IE 10 or older => return version number | ||
return parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10); | ||
} | ||
var trident = ua.indexOf('trident/'); | ||
if (trident > 0) { | ||
// IE 11 => return version number | ||
var rv = ua.indexOf('rv:'); | ||
return parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10); | ||
} | ||
var edge = ua.indexOf('edge/'); | ||
if (edge > 0) { | ||
// Edge (IE 12+) => return version number | ||
return parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10); | ||
} | ||
// other browser | ||
return false; | ||
}, | ||
_parseUA: function(userAgent) { | ||
@@ -194,3 +217,3 @@ var ua = userAgent.toLowerCase(), | ||
version: match[ 2 ] || '0', | ||
isIE: Konva._detectIE(ua), | ||
// adding mobile flab | ||
@@ -213,2 +236,3 @@ mobile: mobile, | ||
if (glob.Konva) { | ||
@@ -236,4 +260,4 @@ console.error( | ||
Konva.document = jsdom('<!DOCTYPE html><html><head></head><body></body></html>'); | ||
Konva.window = Konva.document.parentWindow; | ||
Konva.window = jsdom('<!DOCTYPE html><html><head></head><body></body></html>').defaultView; | ||
Konva.document = Konva.window.document; | ||
Konva.window.Image = Canvas.Image; | ||
@@ -240,0 +264,0 @@ Konva._nodeCanvas = Canvas; |
@@ -211,3 +211,13 @@ /*eslint-disable max-depth */ | ||
_getContextFont: function() { | ||
return this.getFontStyle() + SPACE + this.getFontVariant() + SPACE + this.getFontSize() + PX_SPACE + this.getFontFamily(); | ||
// IE don't want to work with usual font style | ||
// bold was not working | ||
// removing font variant will solve | ||
// fix for: https://github.com/konvajs/konva/issues/94 | ||
if (Konva.UA.isIE) { | ||
return this.getFontStyle() + SPACE + this.getFontSize() + PX_SPACE + this.getFontFamily(); | ||
} | ||
return this.getFontStyle() + SPACE + | ||
this.getFontVariant() + SPACE + | ||
this.getFontSize() + PX_SPACE + | ||
this.getFontFamily(); | ||
}, | ||
@@ -214,0 +224,0 @@ _addTextLine: function (line, width) { |
@@ -175,5 +175,11 @@ (function() { | ||
var layers = node.getLayer() || ((node instanceof Konva.Stage) ? node.getLayers() : null); | ||
if (!layers) { | ||
Konva.Util.error( | ||
'Tween constructor have `node` that is not in a layer. Please add node into layer first.' | ||
); | ||
} | ||
this.anim = new Konva.Animation(function() { | ||
that.tween.onEnterFrame(); | ||
}, node.getLayer() || ((node instanceof Konva.Stage) ? node.getLayers() : null)); | ||
}, layers); | ||
@@ -180,0 +186,0 @@ this.tween = new Tween(key, function(i) { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
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
1238921
30027
57