This commit is contained in:
Eric Rowell 2014-03-27 22:02:58 -07:00
parent 2176f0ee51
commit 89db41693c
5 changed files with 58 additions and 32 deletions

View File

@ -1,6 +1,6 @@
{
"name": "KineticJS",
"version": "5.0.2",
"version": "5.1.0",
"homepage": "http://kineticjs.com/",
"authors": [
"Eric Rowell"

View File

@ -1,10 +1,10 @@
/*
* KineticJS JavaScript Framework v5.0.2
* KineticJS JavaScript Framework v5.1.0
* http://www.kineticjs.com/
* Copyright 2013, Eric Rowell
* Licensed under the MIT or GPL Version 2 licenses.
* Date: 2014-03-26
* Date: 2014-03-27
*
* Copyright (C) 2011 - 2013 by Eric Rowell
*
@ -36,7 +36,7 @@ var Kinetic = {};
Kinetic = {
// public
version: '5.0.2',
version: '5.1.0',
// private
stages: [],
@ -2353,14 +2353,6 @@ var Kinetic = {};
sceneContext.save();
hitContext.save();
sceneContext.translate(x * -1, y * -1);
hitContext.translate(x * -1, y * -1);
if (this.nodeType === 'Shape') {
sceneContext.translate(this.x() * -1, this.y() * -1);
hitContext.translate(this.x() * -1, this.y() * -1);
}
// this will draw a red border around the cached box for
// debugging purposes
if (drawBorder) {
@ -2374,6 +2366,14 @@ var Kinetic = {};
sceneContext.restore();
}
sceneContext.translate(x * -1, y * -1);
hitContext.translate(x * -1, y * -1);
if (this.nodeType === 'Shape') {
sceneContext.translate(this.x() * -1, this.y() * -1);
hitContext.translate(this.x() * -1, this.y() * -1);
}
this.drawScene(cachedSceneCanvas, this);
this.drawHit(cachedHitCanvas, this);
@ -2485,6 +2485,11 @@ var Kinetic = {};
* var eventType = evt.type;<br>
* });<br><br>
*
* // get native event object<br>
* node.on('click tap', function(evt) {<br>
* var nativeEvent = evt.evt;<br>
* });<br><br>
*
* // for change events, get the old and new val<br>
* node.on('xChange', function(evt) {<br>
* var oldVal = evt.oldVal;<br>
@ -6858,14 +6863,21 @@ var Kinetic = {};
}
node._setDragPosition(evt);
if(!dd.isDragging) {
dd.isDragging = true;
node.fire('dragstart', evt, true);
node.fire('dragstart', {
type : 'dragstart',
target : node,
evt : evt
}, true);
}
// execute ondragmove if defined
node.fire('dragmove', evt, true);
node.fire('dragmove', {
type : 'dragmove',
target : node,
evt : evt
}, true);
}
},
_endDragBefore: function(evt) {
@ -6900,7 +6912,11 @@ var Kinetic = {};
var dragEndNode = evt.dragEndNode;
if (evt && dragEndNode) {
dragEndNode.fire('dragend', evt, true);
dragEndNode.fire('dragend', {
type : 'dragend',
target : dragEndNode,
evt : evt
}, true);
}
}
};
@ -9631,6 +9647,20 @@ var Kinetic = {};
return;
},
clearCache : function() {
},
removeChildren : function() {
Kinetic.Container.prototype.removeChildren.call(this);
// clear all canvases
while (this.content.firstChild) {
this.content.removeChild(this.content.firstChild);
}
},
destroyChildren : function() {
Kinetic.Container.prototype.destroyChildren.call(this);
// clear all canvases
while (this.content.firstChild) {
this.content.removeChild(this.content.firstChild);
}
}
});
Kinetic.Util.extend(Kinetic.Stage, Kinetic.Container);
@ -9774,14 +9804,12 @@ var Kinetic = {};
return this;
},
remove: function() {
var stage = this.getStage(),
canvas = this.getCanvas(),
_canvas = canvas._canvas;
var _canvas = this.getCanvas()._canvas;
Kinetic.Node.prototype.remove.call(this);
if(stage && _canvas && Kinetic.Util._isInDocument(_canvas)) {
stage.content.removeChild(_canvas);
if(_canvas && _canvas.parentNode && Kinetic.Util._isInDocument(_canvas)) {
_canvas.parentNode.removeChild(_canvas);
}
return this;
},

10
kinetic.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
{
"name": "KineticJS",
"version": "5.0.2",
"version": "5.1.0",
"devDependencies": {
"grunt-contrib-jshint": "0.8.0",
"grunt-contrib-nodeunit": "0.3.2",

View File

@ -116,14 +116,12 @@
return this;
},
remove: function() {
var stage = this.getStage(),
canvas = this.getCanvas(),
_canvas = canvas._canvas;
var _canvas = this.getCanvas()._canvas;
Kinetic.Node.prototype.remove.call(this);
if(stage && _canvas && Kinetic.Util._isInDocument(_canvas)) {
stage.content.removeChild(_canvas);
if(_canvas && _canvas.parentNode && Kinetic.Util._isInDocument(_canvas)) {
_canvas.parentNode.removeChild(_canvas);
}
return this;
},