I'm struggling to draw a bunch of items as a whole simply setting their DrawItem.drawGroup property, then drawing the group. I know that passing them directly to DrawGroup.drawItems instead works.
The docs say
Hence I'd expect the following snippet should suffice to draw a line, but unfortunately this is not the case
Instead if I adapt it to use the drawItems attribute it works like a charm
I guess I've missed some directive, but I cannot figure out which one... any idea?
Reproduced on latest showcase (SC Version: 10.0p Built: 2014-
12-09)
The docs say
DrawItems are added to a DrawGroup by creating the DrawItems with DrawItem.drawGroup set to a drawGroup, or by creating a DrawGroup with DrawGroup.drawItems.
Code:
var mainPane = isc.DrawPane.create({ autoDraw: false, showEdges: true, width: 200, height: 200 }); var group = isc.DrawGroup.create({ autoDraw: false, drawPane: mainPane }); isc.DrawLine.create({ autoDraw: false, drawGroup: group, startPoint: [0, 200], endPoint: [200, 0] }); isc.HStack.create({ width: "100%", members: [mainPane] }); group.draw();
Code:
var mainPane = isc.DrawPane.create({ autoDraw: false, showEdges: true, width: 200, height: 200 }); var item = isc.DrawLine.create({ autoDraw: false, drawGroup: group, startPoint: [0, 200], endPoint: [200, 0] }); var group = isc.DrawGroup.create({ autoDraw: false, drawPane: mainPane, drawItems: [item] }); isc.HStack.create({ width: "100%", members: [mainPane] }); group.draw();
Reproduced on latest showcase (SC Version: 10.0p Built: 2014-
12-09)
Comment