PDA

View Full Version : auto height and width of draw.Component



arvindwill
2 Nov 2012, 4:12 AM
If we provide floating:true for Ext.draw.Component then is it mandatory to specify height and width of the component. As generating the lines at runtime height and width cant be set.

var lollypop=Ext.create('Ext.draw.Component',{
id:'lineas',
renderTo:Ext.get('workspacePanel'),
floating:true,
items:[{
type:'path',
'stroke-width':4,
stroke:'#777',
x:0,
y:0,
path:['M '+PTS.startX+' '+PTS.startY,'L '+PTS.endX+' '+PTS.endY].join(' ')
}]
});

Is there any way to draw a line which can be floating on the panel without using 'path' sprite.

mitchellsimoens
5 Nov 2012, 6:25 AM
The draw component will need a provided size or within a layout.