我正在尝试绘制一个以文本为中心的矩形,同时将元素分组。这是我的代码:
var draw = SVG('canvas')
var group = draw.group();
var rect = draw.rect(100,100).fill('#f09')
group.add(rect);
var text = draw.text('AAA');
text.font({anchor: 'middle', size: 30, family: 'Helvetica'});
text.move(50,50);
group.add(text);
group.move(100,100);
JSFiddle:http: //jsfiddle.net/Lqw7n/2/
结果对我来说毫无意义。