mirror of
https://github.com/konvajs/konva.git
synced 2025-09-18 18:27:58 +08:00
formatting
This commit is contained in:
@@ -55,7 +55,7 @@ var text = new Konva.Text({
|
||||
```
|
||||
|
||||
- Improved text positioning to match DOM/CSS rendering. To restore previous behaviour use `Konva.legacyTextRendering = true`;
|
||||
- Native filters support via `node.filters(['blur(10px)'])`. Native fitlers works MUCH faster if supported nativily (Chrome, Firefox). If there is no native support, Konva will automatially fallback to functional filter (on Safari).
|
||||
- Native filters support via `node.filters(['blur(10px)'])`. Native fitlers works MUCH faster if supported nativily (Chrome, Firefox). If there is no native support, Konva will automatially fallback to functional filter (on Safari).
|
||||
- **New**: Added `Konva.Filters.Brightness` filter in replace of deprecated `Konva.Filters.Brighten` to better match with css filters logic.
|
||||
- Fixed corner radius render for `Konva.Rect` when negative width or height are used
|
||||
- Added `cornerRadius` support for `Konva.RegularPolygon`
|
||||
|
@@ -5218,12 +5218,16 @@ describe('Transformer', function () {
|
||||
|
||||
var back = tr.findOne('.back');
|
||||
assert.notEqual(back, null, 'Back shape should exist');
|
||||
assert.equal(back!.draggable(), false, 'Back should not be draggable when node is not draggable');
|
||||
assert.equal(
|
||||
back!.draggable(),
|
||||
false,
|
||||
'Back should not be draggable when node is not draggable'
|
||||
);
|
||||
|
||||
// Try to drag via back area - should not move
|
||||
var initialX = rect.x();
|
||||
var initialY = rect.y();
|
||||
|
||||
|
||||
simulateMouseDown(tr, {
|
||||
x: 75, // center of the rect/back area
|
||||
y: 75,
|
||||
@@ -5237,8 +5241,16 @@ describe('Transformer', function () {
|
||||
y: 85,
|
||||
});
|
||||
|
||||
assert.equal(rect.x(), initialX, 'Rect should not move when dragging back area of non-draggable node');
|
||||
assert.equal(rect.y(), initialY, 'Rect should not move when dragging back area of non-draggable node');
|
||||
assert.equal(
|
||||
rect.x(),
|
||||
initialX,
|
||||
'Rect should not move when dragging back area of non-draggable node'
|
||||
);
|
||||
assert.equal(
|
||||
rect.y(),
|
||||
initialY,
|
||||
'Rect should not move when dragging back area of non-draggable node'
|
||||
);
|
||||
});
|
||||
|
||||
it('should be draggable via back area when at least one attached node is draggable', function () {
|
||||
@@ -5275,7 +5287,11 @@ describe('Transformer', function () {
|
||||
|
||||
var back = tr.findOne('.back');
|
||||
assert.notEqual(back, null, 'Back shape should exist');
|
||||
assert.equal(back!.draggable(), true, 'Back should be draggable when at least one node is draggable');
|
||||
assert.equal(
|
||||
back!.draggable(),
|
||||
true,
|
||||
'Back should be draggable when at least one node is draggable'
|
||||
);
|
||||
});
|
||||
|
||||
it('should update back draggable when node draggable property changes', function () {
|
||||
@@ -5306,11 +5322,19 @@ describe('Transformer', function () {
|
||||
|
||||
// Change node to non-draggable
|
||||
rect.draggable(false);
|
||||
assert.equal(back!.draggable(), false, 'Back should become non-draggable when node becomes non-draggable');
|
||||
assert.equal(
|
||||
back!.draggable(),
|
||||
false,
|
||||
'Back should become non-draggable when node becomes non-draggable'
|
||||
);
|
||||
|
||||
// Change back to draggable
|
||||
rect.draggable(true);
|
||||
assert.equal(back!.draggable(), true, 'Back should become draggable when node becomes draggable');
|
||||
assert.equal(
|
||||
back!.draggable(),
|
||||
true,
|
||||
'Back should become draggable when node becomes draggable'
|
||||
);
|
||||
});
|
||||
|
||||
it('should handle mixed draggable states correctly', function () {
|
||||
@@ -5347,14 +5371,26 @@ describe('Transformer', function () {
|
||||
|
||||
var back = tr.findOne('.back');
|
||||
assert.notEqual(back, null, 'Back shape should exist');
|
||||
assert.equal(back!.draggable(), true, 'Back should be draggable when at least one node is draggable');
|
||||
assert.equal(
|
||||
back!.draggable(),
|
||||
true,
|
||||
'Back should be draggable when at least one node is draggable'
|
||||
);
|
||||
|
||||
// Make both non-draggable
|
||||
rect1.draggable(false);
|
||||
assert.equal(back!.draggable(), false, 'Back should be non-draggable when all nodes are non-draggable');
|
||||
assert.equal(
|
||||
back!.draggable(),
|
||||
false,
|
||||
'Back should be non-draggable when all nodes are non-draggable'
|
||||
);
|
||||
|
||||
// Make one draggable again
|
||||
rect2.draggable(true);
|
||||
assert.equal(back!.draggable(), true, 'Back should be draggable when at least one node is draggable');
|
||||
assert.equal(
|
||||
back!.draggable(),
|
||||
true,
|
||||
'Back should be draggable when at least one node is draggable'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
Reference in New Issue
Block a user