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/
|
||||
* Copyright 2013, Eric Rowell
|
||||
* Licensed under the MIT or GPL Version 2 licenses.
|
||||
* Date: 2014-05-22
|
||||
* Date: 2014-05-29
|
||||
*
|
||||
* Copyright (C) 2011 - 2013 by Eric Rowell
|
||||
*
|
||||
@@ -10837,9 +10837,8 @@ var Kinetic = {};
|
||||
this.sceneFunc(this._sceneFunc);
|
||||
},
|
||||
_sceneFunc: function(context) {
|
||||
var r = this.getRadius(),
|
||||
rx = r.x,
|
||||
ry = r.y;
|
||||
var rx = this.getRadiusX(),
|
||||
ry = this.getRadiusY();
|
||||
|
||||
context.beginPath();
|
||||
context.save();
|
||||
@@ -10853,11 +10852,11 @@ var Kinetic = {};
|
||||
},
|
||||
// implements Shape.prototype.getWidth()
|
||||
getWidth: function() {
|
||||
return this.getRadius().x * 2;
|
||||
return this.getRadiusX() * 2;
|
||||
},
|
||||
// implements Shape.prototype.getHeight()
|
||||
getHeight: function() {
|
||||
return this.getRadius().y * 2;
|
||||
return this.getRadiusY() * 2;
|
||||
},
|
||||
// implements Shape.prototype.setWidth()
|
||||
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);
|
||||
},
|
||||
_sceneFunc: function(context) {
|
||||
var r = this.getRadius(),
|
||||
rx = r.x,
|
||||
ry = r.y;
|
||||
var rx = this.getRadiusX(),
|
||||
ry = this.getRadiusY();
|
||||
|
||||
context.beginPath();
|
||||
context.save();
|
||||
@@ -48,11 +47,11 @@
|
||||
},
|
||||
// implements Shape.prototype.getWidth()
|
||||
getWidth: function() {
|
||||
return this.getRadius().x * 2;
|
||||
return this.getRadiusX() * 2;
|
||||
},
|
||||
// implements Shape.prototype.getHeight()
|
||||
getHeight: function() {
|
||||
return this.getRadius().y * 2;
|
||||
return this.getRadiusY() * 2;
|
||||
},
|
||||
// implements Shape.prototype.setWidth()
|
||||
setWidth: function(width) {
|
||||
|
Reference in New Issue
Block a user