Have PathItem constructor call this.base() and don't draw item when it is hidden

This commit is contained in:
Jonathan Puckey 2011-02-11 18:30:48 +01:00
parent b47e896389
commit 34b9258e8e

View file

@ -39,6 +39,7 @@ PathItem = Item.extend(new function() {
beans: true, beans: true,
initialize: function() { initialize: function() {
this.base();
this.closed = false; this.closed = false;
this.segments = [];//new SegmentList(this); this.segments = [];//new SegmentList(this);
this.bounds = new Rectangle(); this.bounds = new Rectangle();
@ -361,6 +362,7 @@ PathItem = Item.extend(new function() {
}, },
draw: function(ctx) { draw: function(ctx) {
if(!this.visible) return;
ctx.beginPath(); ctx.beginPath();
var cp1; var cp1;
for(var i = 0, l = this.segments.length; i < l; i++) { for(var i = 0, l = this.segments.length; i < l; i++) {