small optimization

This commit is contained in:
Лаврёнов Антон
2014-05-29 14:13:10 +08:00
parent 540f526c4e
commit 24f7bdbafc
3 changed files with 11 additions and 13 deletions

View File

@@ -4,7 +4,7 @@
* http://www.kineticjs.com/ * http://www.kineticjs.com/
* Copyright 2013, Eric Rowell * Copyright 2013, Eric Rowell
* Licensed under the MIT or GPL Version 2 licenses. * Licensed under the MIT or GPL Version 2 licenses.
* Date: 2014-05-22 * Date: 2014-05-29
* *
* Copyright (C) 2011 - 2013 by Eric Rowell * Copyright (C) 2011 - 2013 by Eric Rowell
* *
@@ -10837,9 +10837,8 @@ var Kinetic = {};
this.sceneFunc(this._sceneFunc); this.sceneFunc(this._sceneFunc);
}, },
_sceneFunc: function(context) { _sceneFunc: function(context) {
var r = this.getRadius(), var rx = this.getRadiusX(),
rx = r.x, ry = this.getRadiusY();
ry = r.y;
context.beginPath(); context.beginPath();
context.save(); context.save();
@@ -10853,11 +10852,11 @@ var Kinetic = {};
}, },
// implements Shape.prototype.getWidth() // implements Shape.prototype.getWidth()
getWidth: function() { getWidth: function() {
return this.getRadius().x * 2; return this.getRadiusX() * 2;
}, },
// implements Shape.prototype.getHeight() // implements Shape.prototype.getHeight()
getHeight: function() { getHeight: function() {
return this.getRadius().y * 2; return this.getRadiusY() * 2;
}, },
// implements Shape.prototype.setWidth() // implements Shape.prototype.setWidth()
setWidth: function(width) { setWidth: function(width) {

4
kinetic.min.js vendored

File diff suppressed because one or more lines are too long

View File

@@ -32,9 +32,8 @@
this.sceneFunc(this._sceneFunc); this.sceneFunc(this._sceneFunc);
}, },
_sceneFunc: function(context) { _sceneFunc: function(context) {
var r = this.getRadius(), var rx = this.getRadiusX(),
rx = r.x, ry = this.getRadiusY();
ry = r.y;
context.beginPath(); context.beginPath();
context.save(); context.save();
@@ -48,11 +47,11 @@
}, },
// implements Shape.prototype.getWidth() // implements Shape.prototype.getWidth()
getWidth: function() { getWidth: function() {
return this.getRadius().x * 2; return this.getRadiusX() * 2;
}, },
// implements Shape.prototype.getHeight() // implements Shape.prototype.getHeight()
getHeight: function() { getHeight: function() {
return this.getRadius().y * 2; return this.getRadiusY() * 2;
}, },
// implements Shape.prototype.setWidth() // implements Shape.prototype.setWidth()
setWidth: function(width) { setWidth: function(width) {