mirror of
https://github.com/konvajs/konva.git
synced 2025-04-05 20:48:28 +08:00
rebranding updates
This commit is contained in:
parent
3b94673d73
commit
e56454c31e
@ -28,7 +28,7 @@
|
|||||||
* cache node before adding to layer
|
* cache node before adding to layer
|
||||||
* `intersects` function now works for shapes with shadow
|
* `intersects` function now works for shapes with shadow
|
||||||
* Enhancements
|
* Enhancements
|
||||||
* npm package. See https://github.com/ericdrowell/KonvaJS#installation
|
* npm package.
|
||||||
* much better dragging performance
|
* much better dragging performance
|
||||||
* `browserify` support
|
* `browserify` support
|
||||||
* applying opacity to cached node
|
* applying opacity to cached node
|
||||||
|
@ -172,7 +172,7 @@ module.exports = function(grunt) {
|
|||||||
},
|
},
|
||||||
uglify: {
|
uglify: {
|
||||||
options: {
|
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: {
|
build: {
|
||||||
files: {
|
files: {
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "KonvaJS",
|
"name": "konva",
|
||||||
"version": "5.2.0",
|
"version": "5.2.0",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Eric Rowell", "Anton Lavrenov"
|
"Eric Rowell", "Anton Lavrenov"
|
||||||
],
|
],
|
||||||
"homepage": "http://lavrton.github.io/KonvaJS/",
|
"homepage": "http://konvajs.github.io",
|
||||||
"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.",
|
"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": [
|
"keywords": [
|
||||||
"canvas",
|
"canvas",
|
||||||
"animations",
|
"animations",
|
||||||
|
59
konva.js
59
konva.js
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* KonvaJS JavaScript Framework v5.2.0
|
* Konva JavaScript Framework v5.2.0
|
||||||
* http://lavrton.github.io/KonvaJS/
|
* http://konvajs.github.io/
|
||||||
* Licensed under the MIT or GPL Version 2 licenses.
|
* Licensed under the MIT or GPL Version 2 licenses.
|
||||||
* Date: 2015-01-27
|
* Date: 2015-01-27
|
||||||
*
|
*
|
||||||
* Original work Copyright (C) 2011 - 2013 by Eric Rowell
|
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
|
||||||
* Modified work Copyright (C) 2014 - 2015 by Anton Lavrenov
|
* Modified work Copyright (C) 2014 - 2015 by Anton Lavrenov (Konva)
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
@ -7896,7 +7896,9 @@ var Konva = {};
|
|||||||
delete Konva.shapes[this.colorKey];
|
delete Konva.shapes[this.colorKey];
|
||||||
},
|
},
|
||||||
_useBufferCanvas: function() {
|
_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) {
|
drawScene: function(can, top) {
|
||||||
var layer = this.getLayer(),
|
var layer = this.getLayer(),
|
||||||
@ -7933,14 +7935,28 @@ var Konva = {};
|
|||||||
bufferContext.restore();
|
bufferContext.restore();
|
||||||
|
|
||||||
if (hasShadow && !canvas.hitCanvas) {
|
if (hasShadow && !canvas.hitCanvas) {
|
||||||
context.save();
|
// if (this.getShadowBlur()) {
|
||||||
context._applyShadow(this);
|
// 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.drawImage(bufferCanvas._canvas, 0, 0);
|
||||||
context.restore();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
context._applyOpacity(this);
|
|
||||||
context.drawImage(bufferCanvas._canvas, 0, 0);
|
|
||||||
}
|
}
|
||||||
// if buffer canvas is not needed
|
// if buffer canvas is not needed
|
||||||
else {
|
else {
|
||||||
@ -7952,7 +7968,7 @@ var Konva = {};
|
|||||||
var o = this.getAbsoluteTransform(top).getMatrix();
|
var o = this.getAbsoluteTransform(top).getMatrix();
|
||||||
context.transform(o[0], o[1], o[2], o[3], o[4], o[5]);
|
context.transform(o[0], o[1], o[2], o[3], o[4], o[5]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hasShadow && !canvas.hitCanvas) {
|
if (hasShadow && !canvas.hitCanvas) {
|
||||||
context.save();
|
context.save();
|
||||||
context._applyShadow(this);
|
context._applyShadow(this);
|
||||||
@ -7962,6 +7978,17 @@ var Konva = {};
|
|||||||
|
|
||||||
context._applyOpacity(this);
|
context._applyOpacity(this);
|
||||||
drawFunc.call(this, context);
|
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();
|
context.restore();
|
||||||
}
|
}
|
||||||
@ -9216,7 +9243,7 @@ var Konva = {};
|
|||||||
DIV = 'div',
|
DIV = 'div',
|
||||||
RELATIVE = 'relative',
|
RELATIVE = 'relative',
|
||||||
INLINE_BLOCK = 'inline-block',
|
INLINE_BLOCK = 'inline-block',
|
||||||
KINETICJS_CONTENT = 'konvajs-content',
|
KONVA_CONTENT = 'konvajs-content',
|
||||||
SPACE = ' ',
|
SPACE = ' ',
|
||||||
UNDERSCORE = '_',
|
UNDERSCORE = '_',
|
||||||
CONTAINER = 'container',
|
CONTAINER = 'container',
|
||||||
@ -9487,6 +9514,7 @@ var Konva = {};
|
|||||||
this.content.style.height = height + PX;
|
this.content.style.height = height + PX;
|
||||||
|
|
||||||
this.bufferCanvas.setSize(width, height);
|
this.bufferCanvas.setSize(width, height);
|
||||||
|
this.bufferCanvas2.setSize(width, height);
|
||||||
this.bufferHitCanvas.setSize(width, height);
|
this.bufferHitCanvas.setSize(width, height);
|
||||||
|
|
||||||
// set layer dimensions
|
// set layer dimensions
|
||||||
@ -9878,7 +9906,7 @@ var Konva = {};
|
|||||||
this.content = Konva.document.createElement(DIV);
|
this.content = Konva.document.createElement(DIV);
|
||||||
this.content.style.position = RELATIVE;
|
this.content.style.position = RELATIVE;
|
||||||
this.content.style.display = INLINE_BLOCK;
|
this.content.style.display = INLINE_BLOCK;
|
||||||
this.content.className = KINETICJS_CONTENT;
|
this.content.className = KONVA_CONTENT;
|
||||||
this.content.setAttribute('role', 'presentation');
|
this.content.setAttribute('role', 'presentation');
|
||||||
container.appendChild(this.content);
|
container.appendChild(this.content);
|
||||||
|
|
||||||
@ -9888,6 +9916,9 @@ var Konva = {};
|
|||||||
this.bufferCanvas = new Konva.SceneCanvas({
|
this.bufferCanvas = new Konva.SceneCanvas({
|
||||||
pixelRatio: 1
|
pixelRatio: 1
|
||||||
});
|
});
|
||||||
|
this.bufferCanvas2 = new Konva.SceneCanvas({
|
||||||
|
pixelRatio: 1
|
||||||
|
});
|
||||||
this.bufferHitCanvas = new Konva.HitCanvas();
|
this.bufferHitCanvas = new Konva.HitCanvas();
|
||||||
|
|
||||||
this._resizeDOM();
|
this._resizeDOM();
|
||||||
|
4
konva.min.js
vendored
4
konva.min.js
vendored
File diff suppressed because one or more lines are too long
15
package.json
15
package.json
@ -1,14 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "konva",
|
"name": "konva",
|
||||||
"version": "5.2.0",
|
"version": "5.2.0",
|
||||||
"author": "Eric Rowell",
|
"author": "Anton Lavrenov",
|
||||||
"contributors" : [
|
|
||||||
{
|
|
||||||
"name" : "Anton Lavrenov",
|
|
||||||
"email" : "lavrton@gmail.com",
|
|
||||||
"url" : "https://twitter.com/lavrton"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"chai": "1.9.2",
|
"chai": "1.9.2",
|
||||||
"finalhandler": "^0.3.3",
|
"finalhandler": "^0.3.3",
|
||||||
@ -40,14 +33,14 @@
|
|||||||
"jsdom": false
|
"jsdom": false
|
||||||
},
|
},
|
||||||
"bugs": {
|
"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",
|
"readmeFilename": "README.md",
|
||||||
"main": "konva.js",
|
"main": "konva.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git://github.com/lavrton/KonvaJS.git"
|
"url": "git://github.com/konvajs/konva.git"
|
||||||
},
|
},
|
||||||
"license": "MIT"
|
"license": "MIT"
|
||||||
}
|
}
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "KonvaJS",
|
"name": "konva",
|
||||||
"version": "@@version",
|
"version": "@@version",
|
||||||
"authors": [
|
"authors": [
|
||||||
"Eric Rowell", "Anton Lavrenov"
|
"Eric Rowell", "Anton Lavrenov"
|
||||||
],
|
],
|
||||||
"homepage": "http://lavrton.github.io/KonvaJS/",
|
"homepage": "http://konvajs.github.io",
|
||||||
"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.",
|
"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": [
|
"keywords": [
|
||||||
"canvas",
|
"canvas",
|
||||||
"animations",
|
"animations",
|
||||||
|
@ -10,9 +10,9 @@
|
|||||||
"dateFormat" : "ddd MMM Do YYYY",
|
"dateFormat" : "ddd MMM Do YYYY",
|
||||||
"outputSourceFiles" : true,
|
"outputSourceFiles" : true,
|
||||||
"outputSourcePath" : true,
|
"outputSourcePath" : true,
|
||||||
"systemName" : "KonvaJS",
|
"systemName" : "Konva",
|
||||||
"footer" : "",
|
"footer" : "",
|
||||||
"copyright" : "KonvaJS Copyright © 2015 The contributors to the KonvaJS project.",
|
"copyright" : "Konva Copyright © 2015 The contributors to the Konva project.",
|
||||||
"navType" : "vertical",
|
"navType" : "vertical",
|
||||||
"theme" : "cosmo",
|
"theme" : "cosmo",
|
||||||
"linenums" : true,
|
"linenums" : true,
|
||||||
@ -21,7 +21,7 @@
|
|||||||
"highlightTutorialCode" : true,
|
"highlightTutorialCode" : true,
|
||||||
"analytics" : {
|
"analytics" : {
|
||||||
"ua" : "UA-54202824-2",
|
"ua" : "UA-54202824-2",
|
||||||
"domain" : "http://lavrton.github.io/KonvaJS"
|
"domain" : "http://konvajs.github.io"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"markdown" : {
|
"markdown" : {
|
||||||
|
Binary file not shown.
Before Width: | Height: | Size: 6.2 KiB |
@ -1,12 +1,12 @@
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* KonvaJS JavaScript Framework v@@version
|
* Konva JavaScript Framework v@@version
|
||||||
* http://lavrton.github.io/KonvaJS/
|
* http://konvajs.github.io/
|
||||||
* Licensed under the MIT or GPL Version 2 licenses.
|
* Licensed under the MIT or GPL Version 2 licenses.
|
||||||
* Date: @@date
|
* Date: @@date
|
||||||
*
|
*
|
||||||
* Original work Copyright (C) 2011 - 2013 by Eric Rowell
|
* Original work Copyright (C) 2011 - 2013 by Eric Rowell (KineticJS)
|
||||||
* Modified work Copyright (C) 2014 - 2015 by Anton Lavrenov
|
* Modified work Copyright (C) 2014 - 2015 by Anton Lavrenov (Konva)
|
||||||
*
|
*
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
* of this software and associated documentation files (the "Software"), to deal
|
* of this software and associated documentation files (the "Software"), to deal
|
||||||
|
Loading…
Reference in New Issue
Block a user