changed offset to center

This commit is contained in:
Eric Rowell
2014-01-04 23:56:33 -08:00
parent 7e2c6c97f8
commit fae1c538f3
8 changed files with 93 additions and 89 deletions

View File

@@ -13,7 +13,7 @@ suite('Image', function(){
image: imageObj,
width: 100,
height: 100,
offset: {x: 50, y: 30},
center: {x: 50, y: 30},
crop: {x: 135, y: 7, width: 167, height: 134},
draggable: true
});
@@ -31,8 +31,8 @@ suite('Image', function(){
assert.equal(darth.getY(), 60);
assert.equal(darth.getWidth(), 100);
assert.equal(darth.getHeight(), 100);
assert.equal(darth.getOffset().x, 50);
assert.equal(darth.getOffset().y, 30);
assert.equal(darth.center().x, 50);
assert.equal(darth.center().y, 30);
assert.equal(Kinetic.Util._isElement(darth.getImage()), true);
var crop = null;
@@ -88,7 +88,8 @@ suite('Image', function(){
image: imageObj,
width: 100,
height: 100,
offset: [50, 30],
centerX: 50,
centerY: 30,
crop: {x: 135, y: 7, width: 167, height: 134},
draggable: true
});
@@ -301,7 +302,7 @@ suite('Image', function(){
image: imageObj,
width: 100,
height: 100,
offset: {x: 50, y:30},
center: {x: 50, y:30},
draggable: true,
opacity: 0.5,
shadowColor: 'black',
@@ -336,7 +337,7 @@ suite('Image', function(){
image: imageObj,
width: 100,
height: 100,
offset: {x: 50, y: 30},
center: {x: 50, y: 30},
draggable: true,
opacity: 0.5,
shadowColor: 'black',

View File

@@ -82,7 +82,7 @@ suite('Rect', function(){
fill: 'green',
stroke: 'black',
strokeWidth: 4,
offset: {x: 50, y: 0},
center: {x: 50, y: 0},
scale: {x: 2, y: 2},
cornerRadius: 15,
draggable: true

View File

@@ -44,8 +44,8 @@ suite('Text', function(){
});
// center text box
rect.setOffset(text.getWidth() / 2, text.getHeight() / 2);
text.setOffset(text.getWidth() / 2, text.getHeight() / 2);
rect.center(text.getWidth() / 2, text.getHeight() / 2);
text.center(text.getWidth() / 2, text.getHeight() / 2);
group.add(rect);
group.add(text);
@@ -82,7 +82,7 @@ suite('Text', function(){
});
// center text box
text.setOffset(text.getWidth() / 2, text.getHeight() / 2);
text.center(text.getWidth() / 2, text.getHeight() / 2);
layer.add(text);
stage.add(layer);