mirror of
https://github.com/konvajs/konva.git
synced 2025-10-15 12:34:52 +08:00
reverted center attr back to offset. I think it's more confusing
This commit is contained in:
@@ -13,7 +13,7 @@ suite('Image', function(){
|
||||
image: imageObj,
|
||||
width: 100,
|
||||
height: 100,
|
||||
center: {x: 50, y: 30},
|
||||
offset: {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.center().x, 50);
|
||||
assert.equal(darth.center().y, 30);
|
||||
assert.equal(darth.offset().x, 50);
|
||||
assert.equal(darth.offset().y, 30);
|
||||
assert.equal(Kinetic.Util._isElement(darth.getImage()), true);
|
||||
|
||||
var crop = null;
|
||||
@@ -89,8 +89,8 @@ suite('Image', function(){
|
||||
image: imageObj,
|
||||
width: 100,
|
||||
height: 100,
|
||||
centerX: 50,
|
||||
centerY: 30,
|
||||
offsetX: 50,
|
||||
offsetY: 30,
|
||||
crop: {x: 135, y: 7, width: 167, height: 134},
|
||||
draggable: true
|
||||
});
|
||||
@@ -254,7 +254,7 @@ suite('Image', function(){
|
||||
image: imageObj,
|
||||
width: 100,
|
||||
height: 100,
|
||||
center: {x: 50, y:30},
|
||||
offset: {x: 50, y:30},
|
||||
draggable: true,
|
||||
opacity: 0.5,
|
||||
shadowColor: 'black',
|
||||
@@ -289,7 +289,7 @@ suite('Image', function(){
|
||||
image: imageObj,
|
||||
width: 100,
|
||||
height: 100,
|
||||
center: {x: 50, y: 30},
|
||||
offset: {x: 50, y: 30},
|
||||
draggable: true,
|
||||
opacity: 0.5,
|
||||
shadowColor: 'black',
|
||||
|
@@ -44,8 +44,8 @@ suite('Text', function(){
|
||||
});
|
||||
|
||||
// center text box
|
||||
rect.center(text.getWidth() / 2, text.getHeight() / 2);
|
||||
text.center(text.getWidth() / 2, text.getHeight() / 2);
|
||||
rect.offset(text.getWidth() / 2, text.getHeight() / 2);
|
||||
text.offset(text.getWidth() / 2, text.getHeight() / 2);
|
||||
|
||||
group.add(rect);
|
||||
group.add(text);
|
||||
@@ -82,7 +82,7 @@ suite('Text', function(){
|
||||
});
|
||||
|
||||
// center text box
|
||||
text.center(text.getWidth() / 2, text.getHeight() / 2);
|
||||
text.offset(text.getWidth() / 2, text.getHeight() / 2);
|
||||
|
||||
layer.add(text);
|
||||
stage.add(layer);
|
||||
|
Reference in New Issue
Block a user