mirror of
https://github.com/konvajs/konva.git
synced 2025-11-18 17:21:36 +08:00
fixed bug with _setSize()
This commit is contained in:
12
dist/kinetic-core.js
vendored
12
dist/kinetic-core.js
vendored
@@ -206,8 +206,8 @@ Kinetic.GlobalObject = {
|
||||
|
||||
// val is an array
|
||||
if(Kinetic.GlobalObject._isArray(val)) {
|
||||
obj[key].x = val[2];
|
||||
obj[key].y = val[3];
|
||||
obj[key].width = val[2];
|
||||
obj[key].height = val[3];
|
||||
}
|
||||
// val is an object
|
||||
else if(obj[key] !== undefined) {
|
||||
@@ -233,7 +233,7 @@ window.requestAnimFrame = (function(callback) {
|
||||
// Node
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
* Node constructor. Nodes are entities that can move around
|
||||
* Node constructor. Nodes are entities that can be transformed, layered,
|
||||
* and have events bound to them. They are the building blocks of a KineticJS
|
||||
* application
|
||||
* @constructor
|
||||
@@ -276,7 +276,7 @@ Kinetic.Node.prototype = {
|
||||
* such as 'mousedown mouseup mousemove'. include a namespace to bind an
|
||||
* event by name such as 'click.foobar'.
|
||||
* @param {String} typesStr
|
||||
* @param {function} handler
|
||||
* @param {Function} handler
|
||||
*/
|
||||
on: function(typesStr, handler) {
|
||||
var types = typesStr.split(' ');
|
||||
@@ -2790,10 +2790,6 @@ Kinetic.Shape.prototype = {
|
||||
return (alpha !== undefined && alpha !== 0);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* draw shape
|
||||
* @param {Layer} layer Layer that the shape will be drawn on
|
||||
*/
|
||||
_draw: function(layer) {
|
||||
if(layer !== undefined && this.drawFunc !== undefined) {
|
||||
var stage = layer.getStage();
|
||||
|
||||
4
dist/kinetic-core.min.js
vendored
4
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
@@ -178,8 +178,8 @@ Kinetic.GlobalObject = {
|
||||
|
||||
// val is an array
|
||||
if(Kinetic.GlobalObject._isArray(val)) {
|
||||
obj[key].x = val[2];
|
||||
obj[key].y = val[3];
|
||||
obj[key].width = val[2];
|
||||
obj[key].height = val[3];
|
||||
}
|
||||
// val is an object
|
||||
else if(obj[key] !== undefined) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
// Node
|
||||
///////////////////////////////////////////////////////////////////////
|
||||
/**
|
||||
* Node constructor. Nodes are entities that can move around
|
||||
* Node constructor. Nodes are entities that can be transformed, layered,
|
||||
* and have events bound to them. They are the building blocks of a KineticJS
|
||||
* application
|
||||
* @constructor
|
||||
@@ -45,7 +45,7 @@ Kinetic.Node.prototype = {
|
||||
* such as 'mousedown mouseup mousemove'. include a namespace to bind an
|
||||
* event by name such as 'click.foobar'.
|
||||
* @param {String} typesStr
|
||||
* @param {function} handler
|
||||
* @param {Function} handler
|
||||
*/
|
||||
on: function(typesStr, handler) {
|
||||
var types = typesStr.split(' ');
|
||||
|
||||
@@ -340,10 +340,6 @@ Kinetic.Shape.prototype = {
|
||||
return (alpha !== undefined && alpha !== 0);
|
||||
}
|
||||
},
|
||||
/**
|
||||
* draw shape
|
||||
* @param {Layer} layer Layer that the shape will be drawn on
|
||||
*/
|
||||
_draw: function(layer) {
|
||||
if(layer !== undefined && this.drawFunc !== undefined) {
|
||||
var stage = layer.getStage();
|
||||
|
||||
@@ -105,7 +105,7 @@ Test.prototype.tests = {
|
||||
layer.add(group);
|
||||
stage.add(layer);
|
||||
|
||||
test(circle.getFill().repeat === 'no-repeat', 'repeat option should be no-repeat');
|
||||
test(circle.getFill().repeat === 'no-repeat', 'repeat option should be no-repeat');
|
||||
};
|
||||
imageObj.src = '../darth-vader.jpg';
|
||||
|
||||
@@ -999,16 +999,8 @@ Test.prototype.tests = {
|
||||
image: imageObj,
|
||||
width: 100,
|
||||
height: 100,
|
||||
centerOffset: {
|
||||
x: 50,
|
||||
y: 30
|
||||
},
|
||||
crop: {
|
||||
x: 20,
|
||||
y: 20,
|
||||
width: 200,
|
||||
height: 250
|
||||
}
|
||||
centerOffset: [50, 30],
|
||||
crop: [20, 20, 200, 250]
|
||||
});
|
||||
|
||||
layer.add(darth);
|
||||
|
||||
Reference in New Issue
Block a user