On KnovaJS, how can I set the width and height of a layer?
http://konvajs.github.io/api/Konva.Layer.html
I tried:
var layer = new Konva.Layer({x: 100, y: 200, width: 500, height: 500});
Only x and y properties work.
On KnovaJS, how can I set the width and height of a layer?
http://konvajs.github.io/api/Konva.Layer.html
I tried:
var layer = new Konva.Layer({x: 100, y: 200, width: 500, height: 500});
Only x and y properties work.
According to Konvajs documentation, both
width()
andheight()
are getters/setters. However for layers in particular, the getter will return the stage width/height and if you want to set the width/height, you should usestage.width(500);
andstage.height(500);
, respectively.