mirror of
https://github.com/konvajs/konva.git
synced 2025-11-18 17:21:36 +08:00
fixed bug with setSize method in Image object, and tweaked shape caching performance test to demonstrate a 4x drawing performance boost
This commit is contained in:
9
dist/kinetic-core.js
vendored
9
dist/kinetic-core.js
vendored
@@ -3,7 +3,7 @@
|
||||
* http://www.kineticjs.com/
|
||||
* Copyright 2012, Eric Rowell
|
||||
* Licensed under the MIT or GPL Version 2 licenses.
|
||||
* Date: Jul 21 2012
|
||||
* Date: Jul 22 2012
|
||||
*
|
||||
* Copyright (C) 2011 - 2012 by Eric Rowell
|
||||
*
|
||||
@@ -3956,11 +3956,6 @@ Kinetic.Image = Kinetic.Shape.extend({
|
||||
};
|
||||
// call super constructor
|
||||
this._super(config);
|
||||
|
||||
var that = this;
|
||||
this.on('filterChange', function() {
|
||||
that._applyFilter();
|
||||
});
|
||||
},
|
||||
/**
|
||||
* set width and height
|
||||
@@ -3968,7 +3963,7 @@ Kinetic.Image = Kinetic.Shape.extend({
|
||||
* @methodOf Kinetic.Image.prototype
|
||||
*/
|
||||
setSize: function() {
|
||||
var size = Kinetic.GlobalObject._getSize(Array.prototype.slice.call(arguments));
|
||||
var size = Kinetic.Type._getSize(Array.prototype.slice.call(arguments));
|
||||
this.setAttrs(size);
|
||||
},
|
||||
/**
|
||||
|
||||
4
dist/kinetic-core.min.js
vendored
4
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -41,11 +41,6 @@ Kinetic.Image = Kinetic.Shape.extend({
|
||||
};
|
||||
// call super constructor
|
||||
this._super(config);
|
||||
|
||||
var that = this;
|
||||
this.on('filterChange', function() {
|
||||
that._applyFilter();
|
||||
});
|
||||
},
|
||||
/**
|
||||
* set width and height
|
||||
@@ -53,7 +48,7 @@ Kinetic.Image = Kinetic.Shape.extend({
|
||||
* @methodOf Kinetic.Image.prototype
|
||||
*/
|
||||
setSize: function() {
|
||||
var size = Kinetic.GlobalObject._getSize(Array.prototype.slice.call(arguments));
|
||||
var size = Kinetic.Type._getSize(Array.prototype.slice.call(arguments));
|
||||
this.setAttrs(size);
|
||||
},
|
||||
/**
|
||||
|
||||
@@ -91,7 +91,13 @@ Test.prototype.tests = {
|
||||
strokeWidth: 5,
|
||||
numPoints: 5,
|
||||
x: Math.random() * stage.getWidth(),
|
||||
y: Math.random() * stage.getHeight()
|
||||
y: Math.random() * stage.getHeight(),
|
||||
shadow: {
|
||||
offset: 5,
|
||||
color: 'black',
|
||||
blur: 5,
|
||||
alpha: 0.5
|
||||
}
|
||||
});
|
||||
|
||||
layer.add(star);
|
||||
@@ -117,13 +123,18 @@ Test.prototype.tests = {
|
||||
strokeWidth: 5,
|
||||
numPoints: 5,
|
||||
x: 70,
|
||||
y: 70
|
||||
y: 70,
|
||||
shadow: {
|
||||
offset: 5,
|
||||
color: 'black',
|
||||
blur: 5,
|
||||
alpha: 0.5
|
||||
}
|
||||
});
|
||||
|
||||
layer.add(star);
|
||||
stage.add(layer);
|
||||
|
||||
console.log('call toImage')
|
||||
star.toImage({
|
||||
callback: function(img) {
|
||||
startTimer();
|
||||
|
||||
Reference in New Issue
Block a user