new transformsEnabled property which yields absolute best rendering performance

This commit is contained in:
Eric Rowell
2013-12-10 23:28:46 -08:00
parent 44b5b63263
commit 6d31f6ed08
6 changed files with 180 additions and 93 deletions

View File

@@ -85,24 +85,25 @@
function make_shape(color) {
if (VERSION === 'new') {
// return new Kinetic.Rect({
// fill: color,
// width: 10,
// height: 10
// });
return new Kinetic.Rect({
fill: color,
width: 10,
height: 10,
transformsEnabled: false
});
return new Kinetic.Shape({
drawFunc: function(context) {
var _context = context._context;
_context.beginPath();
_context.rect(0, 0, 10, 10);
_context.closePath();
_context.fillStyle = 'red';
_context.fill();
}
});
// return new Kinetic.Shape({
// drawFunc: function(context) {
// var _context = context._context;
// _context.beginPath();
// _context.rect(0, 0, 10, 10);
// _context.closePath();
// _context.fillStyle = 'red';
// _context.fill();
// }
// });
} else {