mirror of
https://github.com/konvajs/konva.git
synced 2025-12-05 03:24:23 +08:00
introduced new setDefaultAttrs() method which greatly simplifies the logic required inside node constructors. This will also make plugin creation much easier
This commit is contained in:
11
src/Stage.js
11
src/Stage.js
@@ -12,12 +12,11 @@
|
||||
* @param {int} height
|
||||
*/
|
||||
Kinetic.Stage = function(config) {
|
||||
// default attrs
|
||||
if(this.attrs === undefined) {
|
||||
this.attrs = {};
|
||||
}
|
||||
this.attrs.width = 400;
|
||||
this.attrs.height = 200;
|
||||
this.setDefaultAttrs({
|
||||
width: 400,
|
||||
height: 200
|
||||
});
|
||||
|
||||
this.nodeType = 'Stage';
|
||||
this.ids = {};
|
||||
this.names = {};
|
||||
|
||||
Reference in New Issue
Block a user