mirror of
https://github.com/konvajs/konva.git
synced 2026-01-18 19:51:21 +08:00
added skew transform courtesy of danielkur #188
This commit is contained in:
@@ -600,6 +600,41 @@ Test.Modules.NODE = {
|
||||
layer.add(rect);
|
||||
stage.add(layer);
|
||||
},
|
||||
'skew': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
container: containerId,
|
||||
width: 578,
|
||||
height: 200
|
||||
});
|
||||
var layer = new Kinetic.Layer();
|
||||
var rect = new Kinetic.Rect({
|
||||
x: 200,
|
||||
y: 100,
|
||||
width: 100,
|
||||
height: 50,
|
||||
fill: 'green',
|
||||
stroke: 'black',
|
||||
strokeWidth: 4,
|
||||
skewX: 1
|
||||
});
|
||||
|
||||
|
||||
layer.add(rect);
|
||||
stage.add(layer);
|
||||
|
||||
test(rect.getSkewX() === 1, 'rect skewX should be 1');
|
||||
test(rect.getSkewY() === 0, 'rect skewY should be 0');
|
||||
|
||||
/*
|
||||
rect.transitionTo({
|
||||
duration: 4,
|
||||
skewY: -2,
|
||||
easing: 'ease-in-out'
|
||||
|
||||
|
||||
})
|
||||
*/
|
||||
},
|
||||
'init with position, scale, rotation, then change scale': function(containerId) {
|
||||
var stage = new Kinetic.Stage({
|
||||
container: containerId,
|
||||
|
||||
Reference in New Issue
Block a user