mirror of
https://github.com/konvajs/konva.git
synced 2025-09-18 09:50:05 +08:00
Merge branch 'master' of github.com:ericdrowell/KineticJS
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -3,6 +3,7 @@ jsdoc-master
|
||||
dist
|
||||
analysis
|
||||
node_modules
|
||||
bower_components
|
||||
phantomjs.exe
|
||||
|
||||
# Numerous always-ignore extensions
|
||||
|
21
bower.json
Normal file
21
bower.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "KineticJS",
|
||||
"version": "4.7.0",
|
||||
"homepage": "http://kineticjs.com/",
|
||||
"authors": [
|
||||
"Eric Rowell"
|
||||
],
|
||||
"description": "KineticJS 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"
|
||||
],
|
||||
"license": "MIT",
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"bower_components",
|
||||
"test",
|
||||
"tests"
|
||||
]
|
||||
}
|
@@ -238,7 +238,7 @@
|
||||
|
||||
Kinetic.Node.prototype.isDraggable = Kinetic.Node.prototype.getDraggable;
|
||||
|
||||
var html = document.getElementsByTagName('html')[0];
|
||||
var html = document.documentElement;
|
||||
html.addEventListener('mouseup', Kinetic.DD._endDragBefore, true);
|
||||
html.addEventListener('touchend', Kinetic.DD._endDragBefore, true);
|
||||
|
||||
|
@@ -10,7 +10,7 @@
|
||||
if (type !== 'Group' && type !== 'Shape') {
|
||||
Kinetic.Util.error('You may only add groups and shapes to groups.');
|
||||
}
|
||||
},
|
||||
}
|
||||
});
|
||||
Kinetic.Util.extend(Kinetic.Group, Kinetic.Container);
|
||||
})();
|
||||
|
@@ -1210,16 +1210,15 @@
|
||||
},
|
||||
_fire: function(eventType, evt) {
|
||||
var events = this.eventListeners[eventType],
|
||||
len, i;
|
||||
i;
|
||||
|
||||
if (events) {
|
||||
len = events.length;
|
||||
for(i = 0; i < len; i++) {
|
||||
for(i = 0; i < events.length; i++) {
|
||||
events[i].handler.call(this, evt);
|
||||
}
|
||||
}
|
||||
},
|
||||
/*
|
||||
/**
|
||||
* draw both scene and hit graphs. If the node being drawn is the stage, all of the layers will be cleared and redra
|
||||
* @method
|
||||
* @memberof Kinetic.Node.prototype
|
||||
|
@@ -45,7 +45,7 @@
|
||||
|
||||
this._setDrawFuncs();
|
||||
|
||||
this.on('shadowColorChange.kinetic shadowBlurChange.kinetic shadowOffsetChange.kinetic shadowOpacityChange.kinetic', _clearHasShadowCache);
|
||||
this.on('shadowColorChange.kinetic shadowBlurChange.kinetic shadowOffsetChange.kinetic shadowOpacityChange.kinetic shadowEnabledChanged.kinetic', _clearHasShadowCache);
|
||||
},
|
||||
hasChildren: function() {
|
||||
return false;
|
||||
|
@@ -411,7 +411,7 @@
|
||||
}
|
||||
|
||||
// content event
|
||||
this._fire(CONTENT_MOUSEDOWN);
|
||||
this._fire(CONTENT_MOUSEDOWN, evt);
|
||||
|
||||
// always call preventDefault for desktop events because some browsers
|
||||
// try to drag and drop the canvas element
|
||||
@@ -451,7 +451,7 @@
|
||||
}
|
||||
}
|
||||
// content events
|
||||
this._fire(CONTENT_MOUSEUP);
|
||||
this._fire(CONTENT_MOUSEUP, evt);
|
||||
if (Kinetic.listenClickTap) {
|
||||
this._fire(CONTENT_CLICK, evt);
|
||||
if(fireDblClick) {
|
||||
@@ -598,7 +598,7 @@
|
||||
};
|
||||
},
|
||||
_getContentPosition: function() {
|
||||
var rect = this.content.getBoundingClientRect();
|
||||
var rect = this.content.getBoundingClientRect ? this.content.getBoundingClientRect() : { top: 0, left: 0 };
|
||||
return {
|
||||
top: rect.top,
|
||||
left: rect.left
|
||||
|
@@ -136,7 +136,7 @@
|
||||
filterCanvas = this.filterCanvas = new Kinetic.SceneCanvas({
|
||||
width: crop.width,
|
||||
height: crop.height,
|
||||
pixelRatio: 1,
|
||||
pixelRatio: 1
|
||||
});
|
||||
}
|
||||
|
||||
@@ -231,6 +231,12 @@
|
||||
getHeight: function() {
|
||||
var image = this.getImage();
|
||||
return this.attrs.height || (image ? image.height : 0);
|
||||
},
|
||||
destroy: function(){
|
||||
Kinetic.Shape.prototype.destroy.call(this);
|
||||
delete this.filterCanvas;
|
||||
delete this.attrs;
|
||||
return this;
|
||||
}
|
||||
};
|
||||
Kinetic.Util.extend(Kinetic.Image, Kinetic.Shape);
|
||||
|
Reference in New Issue
Block a user