rebranding updates

This commit is contained in:
lavrton 2015-01-27 15:25:10 +07:00
parent 3b94673d73
commit e56454c31e
10 changed files with 66 additions and 42 deletions

View File

@ -28,7 +28,7 @@
* cache node before adding to layer
* `intersects` function now works for shapes with shadow
* Enhancements
* npm package. See https://github.com/ericdrowell/KonvaJS#installation
* npm package.
* much better dragging performance
* `browserify` support
* applying opacity to cached node

View File

@ -172,7 +172,7 @@ module.exports = function(grunt) {
},
uglify: {
options: {
banner: '/*! KonvaJS v<%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> http://lavrton.github.io/KonvaJS/ by Eric Rowell @ericdrowell, Anton Lavrenov @lavrton - MIT License https://github.com/lavrton/KonvaJS/wiki/License*/\n'
banner: '/*! Konva v<%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> http://konvajs.github.io/ by Anton Lavrenov @lavrton - MIT License https://github.com/konvajs/konva/wiki/License*/\n'
},
build: {
files: {

View File

@ -1,11 +1,11 @@
{
"name": "KonvaJS",
"name": "konva",
"version": "5.2.0",
"authors": [
"Eric Rowell", "Anton Lavrenov"
],
"homepage": "http://lavrton.github.io/KonvaJS/",
"description": "KonvaJS is an HTML5 Canvas JavaScript framework that enables high performance animations, transitions, node nesting, layering, filtering, caching, event handling for desktop and mobile applications, and much more.",
"homepage": "http://konvajs.github.io",
"description": "Konva is an HTML5 Canvas JavaScript framework that enables high performance animations, transitions, node nesting, layering, filtering, caching, event handling for desktop and mobile applications, and much more.",
"keywords": [
"canvas",
"animations",

View File

@ -1,12 +1,12 @@
/*
* KonvaJS JavaScript Framework v5.2.0
* http://lavrton.github.io/KonvaJS/
* Konva JavaScript Framework v5.2.0
* http://konvajs.github.io/
* Licensed under the MIT or GPL Version 2 licenses.
* Date: 2015-01-27
*
* Original work Copyright (C) 2011 - 2013 by Eric Rowell
* Modified work Copyright (C) 2014 - 2015 by Anton Lavrenov
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
* Modified work Copyright (C) 2014 - 2015 by Anton Lavrenov (Konva)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
@ -7896,7 +7896,9 @@ var Konva = {};
delete Konva.shapes[this.colorKey];
},
_useBufferCanvas: function() {
return (this.hasShadow() || this.getAbsoluteOpacity() !== 1) && this.hasFill() && this.hasStroke() && this.getStage();
// return false;
return ((this.getAbsoluteOpacity() !== 1) && this.hasFill() && this.hasStroke()) ||
this.hasShadow() && (this.getAbsoluteOpacity() !== 1) && this.hasFill() && this.hasStroke() && this.getStage();
},
drawScene: function(can, top) {
var layer = this.getLayer(),
@ -7933,14 +7935,28 @@ var Konva = {};
bufferContext.restore();
if (hasShadow && !canvas.hitCanvas) {
context.save();
context._applyShadow(this);
// if (this.getShadowBlur()) {
// context.save();
//// bufferContext.clear();
// var buffer2 = stage.bufferCanvas2;
// buffer2.getContext()._applyShadow(this);
// buffer2.getContext().drawImage(bufferCanvas._canvas);
// buffer2.getContext().fill();
//// drawFunc.call(this, bufferContext);
//// context._applyOpacity(this);
// context.drawImage(buffer2._canvas, 0, 0);
// context.restore();
// } else {
context.save();
context._applyShadow(this);
context._applyOpacity(this);
context.drawImage(bufferCanvas._canvas, 0, 0);
context.restore();
// }
} else {
context._applyOpacity(this);
context.drawImage(bufferCanvas._canvas, 0, 0);
context.restore();
}
context._applyOpacity(this);
context.drawImage(bufferCanvas._canvas, 0, 0);
}
// if buffer canvas is not needed
else {
@ -7952,7 +7968,7 @@ var Konva = {};
var o = this.getAbsoluteTransform(top).getMatrix();
context.transform(o[0], o[1], o[2], o[3], o[4], o[5]);
}
if (hasShadow && !canvas.hitCanvas) {
context.save();
context._applyShadow(this);
@ -7962,6 +7978,17 @@ var Konva = {};
context._applyOpacity(this);
drawFunc.call(this, context);
// // clear stroke shadow
// if (hasShadow && !canvas.hitCanvas) {
// context.setAttr('shadowBlur', 0);
// context.setAttr('shadowColor', 0);
// context.setAttr('shadowOffsetX', 0);
// context.setAttr('shadowOffsetY', 0);
// context.stroke();
// }
}
context.restore();
}
@ -9216,7 +9243,7 @@ var Konva = {};
DIV = 'div',
RELATIVE = 'relative',
INLINE_BLOCK = 'inline-block',
KINETICJS_CONTENT = 'konvajs-content',
KONVA_CONTENT = 'konvajs-content',
SPACE = ' ',
UNDERSCORE = '_',
CONTAINER = 'container',
@ -9487,6 +9514,7 @@ var Konva = {};
this.content.style.height = height + PX;
this.bufferCanvas.setSize(width, height);
this.bufferCanvas2.setSize(width, height);
this.bufferHitCanvas.setSize(width, height);
// set layer dimensions
@ -9878,7 +9906,7 @@ var Konva = {};
this.content = Konva.document.createElement(DIV);
this.content.style.position = RELATIVE;
this.content.style.display = INLINE_BLOCK;
this.content.className = KINETICJS_CONTENT;
this.content.className = KONVA_CONTENT;
this.content.setAttribute('role', 'presentation');
container.appendChild(this.content);
@ -9888,6 +9916,9 @@ var Konva = {};
this.bufferCanvas = new Konva.SceneCanvas({
pixelRatio: 1
});
this.bufferCanvas2 = new Konva.SceneCanvas({
pixelRatio: 1
});
this.bufferHitCanvas = new Konva.HitCanvas();
this._resizeDOM();

4
konva.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,14 +1,7 @@
{
"name": "konva",
"version": "5.2.0",
"author": "Eric Rowell",
"contributors" : [
{
"name" : "Anton Lavrenov",
"email" : "lavrton@gmail.com",
"url" : "https://twitter.com/lavrton"
}
],
"author": "Anton Lavrenov",
"devDependencies": {
"chai": "1.9.2",
"finalhandler": "^0.3.3",
@ -40,14 +33,14 @@
"jsdom": false
},
"bugs": {
"url": "https://github.com/lavrton/KonvaJS/issues"
"url": "https://github.com/konvajs/konva/issues"
},
"homepage" : "http://lavrton.github.io/KonvaJS/",
"homepage" : "http://konvajs.github.io/",
"readmeFilename": "README.md",
"main": "konva.js",
"repository": {
"type": "git",
"url": "git://github.com/lavrton/KonvaJS.git"
"url": "git://github.com/konvajs/konva.git"
},
"license": "MIT"
}

View File

@ -1,11 +1,11 @@
{
"name": "KonvaJS",
"name": "konva",
"version": "@@version",
"authors": [
"Eric Rowell", "Anton Lavrenov"
],
"homepage": "http://lavrton.github.io/KonvaJS/",
"description": "KonvaJS is an HTML5 Canvas JavaScript framework that enables high performance animations, transitions, node nesting, layering, filtering, caching, event handling for desktop and mobile applications, and much more.",
"homepage": "http://konvajs.github.io",
"description": "Konva is an HTML5 Canvas JavaScript framework that enables high performance animations, transitions, node nesting, layering, filtering, caching, event handling for desktop and mobile applications, and much more.",
"keywords": [
"canvas",
"animations",

View File

@ -10,9 +10,9 @@
"dateFormat" : "ddd MMM Do YYYY",
"outputSourceFiles" : true,
"outputSourcePath" : true,
"systemName" : "KonvaJS",
"systemName" : "Konva",
"footer" : "",
"copyright" : "KonvaJS Copyright © 2015 The contributors to the KonvaJS project.",
"copyright" : "Konva Copyright © 2015 The contributors to the Konva project.",
"navType" : "vertical",
"theme" : "cosmo",
"linenums" : true,
@ -21,7 +21,7 @@
"highlightTutorialCode" : true,
"analytics" : {
"ua" : "UA-54202824-2",
"domain" : "http://lavrton.github.io/KonvaJS"
"domain" : "http://konvajs.github.io"
}
},
"markdown" : {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

View File

@ -1,12 +1,12 @@
/*
* KonvaJS JavaScript Framework v@@version
* http://lavrton.github.io/KonvaJS/
* Konva JavaScript Framework v@@version
* http://konvajs.github.io/
* Licensed under the MIT or GPL Version 2 licenses.
* Date: @@date
*
* Original work Copyright (C) 2011 - 2013 by Eric Rowell
* Modified work Copyright (C) 2014 - 2015 by Anton Lavrenov
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
* Modified work Copyright (C) 2014 - 2015 by Anton Lavrenov (Konva)
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal