Index: LzSprite.as =================================================================== --- LzSprite.as (revision 15582) +++ LzSprite.as (working copy) @@ -1273,6 +1273,9 @@ o If false, does not clip the sprite's children to its width and height */ public function setClip( clip:Boolean ):void { + // Clip is never stored, but it's need in setCornerradius + // to check if we have to apply a mask. + this.clip = clip; if (clip) { applyMask(); } else { @@ -1287,10 +1290,14 @@ ms = new Sprite(); ms.graphics.clear(); ms.graphics.beginFill(0xffffff); - ms.graphics.drawRect(0, 0, 1, 1); + if (this.cornerradius > 0) { + ms.graphics.drawRoundRect(0, 0, this.lzwidth, this.lzheight, this.cornerradius*2); + } else { + ms.graphics.drawRect(0, 0, 1, 1); + ms.scaleX = this.lzwidth; + ms.scaleY = this.lzheight; + } ms.graphics.endFill(); - ms.scaleX = this.lzwidth; - ms.scaleY = this.lzheight; addChild(ms); this.mask = ms; this.masksprite = ms; @@ -1301,14 +1308,20 @@ this.mask = ms; } //trace('applyMask [2] ', this.lzwidth, this.lzheight, owner); - ms.scaleX = this.lzwidth; - ms.scaleY = this.lzheight; + if (this.cornerradius == 0) { + ms.scaleX = this.lzwidth; + ms.scaleY = this.lzheight; + } } } public function removeMask():void { if (this.mask != null) { this.removeChild(this.masksprite); + // With add explicitely setting the masksprite to 'null' + // it will still contain the old sprite reference and + // applyMask() will fail to create a new mask + this.masksprite = null; this.mask = null; } } @@ -1807,7 +1820,13 @@ var cornerradius = 0; function setCornerRadius(radius) { + if (this.owner.id.length>4 && this.owner.id.substring(0,4) == 'note') { + } this.cornerradius = radius; + if (this.clip) { + this.removeMask(); + this.applyMask(); + } this.drawBackground(); }