added back compat Factor method and plugged in the methods that changed with the 5.0.0 release

This commit is contained in:
Eric Rowell
2014-01-10 22:58:55 -08:00
parent 79701fcca0
commit 99e7ad4bf0
7 changed files with 49 additions and 5 deletions

View File

@@ -132,14 +132,14 @@
* height: 200<br>
* });<br><br>
*
* // cache a node and show a red border around the bounding box<br>
* // cache a node and draw a red border around the bounding box<br>
* // for debugging purposes<br>
* node.cache({<br>
* x: -30,<br>
* y: -30,<br>
* width: 100,<br>
* height: 200,<br>
* showBorder: true<br>
* drawBorder: true<br>
* });
*/
cache: function(config) {
@@ -148,7 +148,7 @@
y = conf.y || 0,
width = conf.width || this.width(),
height = conf.height || this.height(),
showBorder = conf.showBorder || false,
drawBorder = conf.drawBorder || false,
cachedSceneCanvas = new Kinetic.SceneCanvas({
pixelRatio: 1,
width: width,
@@ -179,7 +179,7 @@
// this will draw a red border around the cached box for
// debugging purposes
if (showBorder) {
if (drawBorder) {
sceneContext = cachedSceneCanvas.getContext();
sceneContext.save();
sceneContext.beginPath();
@@ -1928,6 +1928,12 @@
* node.transformsEnabled('all');
*/
Kinetic.Factory.backCompat(Kinetic.Node, {
rotateDeg: 'rotate',
setRotationDeg: 'setRotation',
getRotationDeg: 'getRotation'
});
Kinetic.Collection.mapMethods([
'on',
'off',