mirror of
https://github.com/konvajs/konva.git
synced 2025-09-22 20:14:01 +08:00
small optimization
This commit is contained in:
11
kinetic.js
11
kinetic.js
@@ -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
4
kinetic.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -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) {
|
||||||
|
Reference in New Issue
Block a user