如何缩放填充而不是Actionscript中的笔划?

JoJ*_*oJo 2 flash actionscript-3

假设我有一个盒子。填充是渐变,并且笔划的厚度为1像素。我如何调整其填充大小,但保持笔触厚度不变?

private function resizeMovieClip(newWidth:Number, newHeight:Number):void 
{
   this.movieClip.width = newWidth;
   this.movieClip.height = newHeight;
}
Run Code Online (Sandbox Code Playgroud)

基本上,我想模拟Javascript对DOM元素的大小调整。在JS中,调整框的大小永远不会改变其边框。

The*_*978 5

lineStyle()的scaleMode设置为LineScaleMode.NONE

var sh:Shape = new Shape();
sh.graphics.lineStyle(1.0, 0x000000, 1.0, false, LineScaleMode.NONE);
sh.graphics.beginFill(0xFF0000, 1.0);
sh.graphics.drawRect(0, 0, 100, 100);
sh.graphics.endFill();

addChild(sh);

sh.scaleX = sh.scaleY = 4.0;
Run Code Online (Sandbox Code Playgroud)