mirror of
https://github.com/konvajs/konva.git
synced 2025-12-21 19:27:08 +08:00
hooked setAttrs into setCrop() method and made the _getSize() method more flexibile by accepting more variations of input. added unit tests
This commit is contained in:
10
src/Node.js
10
src/Node.js
@@ -194,7 +194,7 @@ Kinetic.Node.prototype = {
|
||||
break;
|
||||
/*
|
||||
* includes:
|
||||
* - patttern offset
|
||||
* - fill pattern offset
|
||||
* - shadow offset
|
||||
*/
|
||||
case 'offset':
|
||||
@@ -214,10 +214,10 @@ Kinetic.Node.prototype = {
|
||||
var pos = go._getXY(val);
|
||||
var size = go._getSize(val);
|
||||
|
||||
obj[key].x = pos.x;
|
||||
obj[key].y = pos.y;
|
||||
obj[key].width = size.width;
|
||||
obj[key].height = size.height;
|
||||
go._setAttr(obj[key], 'x', pos.x);
|
||||
go._setAttr(obj[key], 'y', pos.y);
|
||||
go._setAttr(obj[key], 'width', size.width);
|
||||
go._setAttr(obj[key], 'height', size.height);
|
||||
break;
|
||||
default:
|
||||
obj[key] = c[key];
|
||||
|
||||
Reference in New Issue
Block a user