fix cursor on anchors for rotated parent. fix#837

This commit is contained in:
Anton Lavrenov
2020-01-30 11:41:05 -05:00
parent e112c14852
commit 1c85a7ee26
7 changed files with 1407 additions and 53 deletions

View File

@@ -299,7 +299,7 @@ suite('Line', function() {
y: 0,
points: [75, 75, 100, 200, 300, 140],
tension: 0.5,
stroke: '#0f0',
stroke: '#0f0'
});
layer.add(line);

View File

@@ -1412,6 +1412,38 @@ suite('Transformer', function() {
assert.equal(stage.content.style.cursor, 'nwse-resize');
});
test('check correct cursor on rotated parent', function() {
var stage = addStage();
var layer = new Konva.Layer({
x: 100,
y: -50,
rotation: 90
});
stage.add(layer);
var rect = new Konva.Rect({
x: 50,
y: 0,
draggable: true,
width: 100,
height: 100,
fill: 'yellow'
});
layer.add(rect);
var tr = new Konva.Transformer({
node: rect
});
layer.add(tr);
layer.draw();
stage.simulateMouseMove({
x: 50,
y: 1
});
assert.equal(stage.content.style.cursor, 'ns-resize');
});
test('stopTransform method', function() {
var stage = addStage();
var layer = new Konva.Layer();