mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 15:23:44 +08:00
minor code cleanup discovered by Wappworks
This commit is contained in:
parent
24158587e6
commit
68db5bf7c1
12
dist/kinetic-core.js
vendored
12
dist/kinetic-core.js
vendored
@ -427,7 +427,7 @@ Kinetic.Node.prototype = {
|
|||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* set zIndex
|
* set zIndex
|
||||||
* @param {int} index
|
* @param {int} zIndex
|
||||||
*/
|
*/
|
||||||
setZIndex: function(zIndex) {
|
setZIndex: function(zIndex) {
|
||||||
var index = this.index;
|
var index = this.index;
|
||||||
@ -525,7 +525,7 @@ Kinetic.Node.prototype = {
|
|||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* move node to another container
|
* move node to another container
|
||||||
* @param {Layer} newLayer
|
* @param {Container} newContainer
|
||||||
*/
|
*/
|
||||||
moveTo: function(newContainer) {
|
moveTo: function(newContainer) {
|
||||||
var parent = this.parent;
|
var parent = this.parent;
|
||||||
@ -643,6 +643,7 @@ Kinetic.Node.prototype = {
|
|||||||
handle(this);
|
handle(this);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
// Container
|
// Container
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
@ -1688,7 +1689,6 @@ Kinetic.GlobalObject.extend(Kinetic.Shape, Kinetic.Node);
|
|||||||
*/
|
*/
|
||||||
Kinetic.Rect = function(config) {
|
Kinetic.Rect = function(config) {
|
||||||
config.drawFunc = function() {
|
config.drawFunc = function() {
|
||||||
var canvas = this.getCanvas();
|
|
||||||
var context = this.getContext();
|
var context = this.getContext();
|
||||||
context.beginPath();
|
context.beginPath();
|
||||||
context.rect(0, 0, this.width, this.height);
|
context.rect(0, 0, this.width, this.height);
|
||||||
@ -1741,6 +1741,7 @@ Kinetic.Rect.prototype = {
|
|||||||
|
|
||||||
// extend Shape
|
// extend Shape
|
||||||
Kinetic.GlobalObject.extend(Kinetic.Rect, Kinetic.Shape);
|
Kinetic.GlobalObject.extend(Kinetic.Rect, Kinetic.Shape);
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
// Circle
|
// Circle
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
@ -1828,7 +1829,7 @@ Kinetic.Image.prototype = {
|
|||||||
/**
|
/**
|
||||||
* get image
|
* get image
|
||||||
*/
|
*/
|
||||||
getImage: function(image) {
|
getImage: function() {
|
||||||
return this.image;
|
return this.image;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
@ -1869,6 +1870,7 @@ Kinetic.Image.prototype = {
|
|||||||
};
|
};
|
||||||
// extend Shape
|
// extend Shape
|
||||||
Kinetic.GlobalObject.extend(Kinetic.Image, Kinetic.Shape);
|
Kinetic.GlobalObject.extend(Kinetic.Image, Kinetic.Shape);
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
// Polygon
|
// Polygon
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
@ -2090,7 +2092,6 @@ Kinetic.Text = function(config) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
config.drawFunc = function() {
|
config.drawFunc = function() {
|
||||||
var canvas = this.getCanvas();
|
|
||||||
var context = this.getContext();
|
var context = this.getContext();
|
||||||
context.font = this.fontSize + "pt " + this.fontFamily;
|
context.font = this.fontSize + "pt " + this.fontFamily;
|
||||||
context.textBaseline = "middle";
|
context.textBaseline = "middle";
|
||||||
@ -2274,3 +2275,4 @@ Kinetic.Text.prototype = {
|
|||||||
};
|
};
|
||||||
// extend Shape
|
// extend Shape
|
||||||
Kinetic.GlobalObject.extend(Kinetic.Text, Kinetic.Shape);
|
Kinetic.GlobalObject.extend(Kinetic.Text, Kinetic.Shape);
|
||||||
|
|
||||||
|
2
dist/kinetic-core.min.js
vendored
2
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
@ -307,7 +307,7 @@ Kinetic.Node.prototype = {
|
|||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* set zIndex
|
* set zIndex
|
||||||
* @param {int} index
|
* @param {int} zIndex
|
||||||
*/
|
*/
|
||||||
setZIndex: function(zIndex) {
|
setZIndex: function(zIndex) {
|
||||||
var index = this.index;
|
var index = this.index;
|
||||||
@ -405,7 +405,7 @@ Kinetic.Node.prototype = {
|
|||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* move node to another container
|
* move node to another container
|
||||||
* @param {Layer} newLayer
|
* @param {Container} newContainer
|
||||||
*/
|
*/
|
||||||
moveTo: function(newContainer) {
|
moveTo: function(newContainer) {
|
||||||
var parent = this.parent;
|
var parent = this.parent;
|
||||||
|
@ -42,7 +42,7 @@ Kinetic.Image.prototype = {
|
|||||||
/**
|
/**
|
||||||
* get image
|
* get image
|
||||||
*/
|
*/
|
||||||
getImage: function(image) {
|
getImage: function() {
|
||||||
return this.image;
|
return this.image;
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
*/
|
*/
|
||||||
Kinetic.Rect = function(config) {
|
Kinetic.Rect = function(config) {
|
||||||
config.drawFunc = function() {
|
config.drawFunc = function() {
|
||||||
var canvas = this.getCanvas();
|
|
||||||
var context = this.getContext();
|
var context = this.getContext();
|
||||||
context.beginPath();
|
context.beginPath();
|
||||||
context.rect(0, 0, this.width, this.height);
|
context.rect(0, 0, this.width, this.height);
|
||||||
|
@ -29,7 +29,6 @@ Kinetic.Text = function(config) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
config.drawFunc = function() {
|
config.drawFunc = function() {
|
||||||
var canvas = this.getCanvas();
|
|
||||||
var context = this.getContext();
|
var context = this.getContext();
|
||||||
context.font = this.fontSize + "pt " + this.fontFamily;
|
context.font = this.fontSize + "pt " + this.fontFamily;
|
||||||
context.textBaseline = "middle";
|
context.textBaseline = "middle";
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<link rel="stylesheet" type="text/css"href="base.css">
|
<link rel="stylesheet" type="text/css"href="base.css">
|
||||||
<script src="../dist/kinetic-core.js"></script>
|
<script src="../dist/kinetic-v3.8.3.min.js"></script>
|
||||||
<script src="unitTests.js"></script>
|
<script src="unitTests.js"></script>
|
||||||
<script src="testMethods.js"></script>
|
<script src="testMethods.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
Loading…
Reference in New Issue
Block a user