1 pv.SvgScene.rule = function(scenes) { 2 var g = this.group(scenes); 3 for (var i = 0; i < scenes.length; i++) { 4 var s = scenes[i]; 5 6 /* visible */ 7 if (!s.visible) continue; 8 9 /* stroke */ 10 var stroke = pv.color(s.strokeStyle); 11 if (!stroke.opacity) continue; 12 13 var line = this.cache(s, "line", "rule"); 14 line.setAttribute("cursor", s.cursor); 15 line.setAttribute("x1", s.left); 16 line.setAttribute("y1", s.top); 17 line.setAttribute("x2", s.left + s.width); 18 line.setAttribute("y2", s.top + s.height); 19 line.setAttribute("stroke", stroke.color); 20 line.setAttribute("stroke-opacity", stroke.opacity); 21 line.setAttribute("stroke-width", s.lineWidth); 22 this.listen(line, scenes, i); 23 g.appendChild(this.title(line, s)); 24 } 25 }; 26