⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ellipse.as

📁 QS我也没用过
💻 AS
字号:
package qs.graphics
{
	import mx.core.UIComponent;
	import mx.graphics.IFill;
	import mx.graphics.IStroke;
	import flash.geom.Rectangle;

	[Style(name="fill", type="mx.graphics.IFill", inherit="no")]
	[Style(name="stroke", type="mx.graphics.IStroke", inherit="no")]

	public class Ellipse extends UIComponent
	{
		private static var rc:Rectangle = new Rectangle();
		override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
		{
			var f:IFill = getStyle("fill");
			var s:IStroke = getStyle("stroke");
			var o:Number = 0;
				
			graphics.clear();
						
			if(s != null)
			{
				o = s.weight/2;
				unscaledHeight -=s.weight;
				unscaledWidth -= s.weight;
				s.apply(graphics);
			}
			else
				graphics.lineStyle(0,0,0);

			if(f != null)
			{
				rc.left = rc.right = o;
				rc.width = unscaledWidth;
				rc.height = unscaledHeight;
				f.begin(graphics,rc);
			}
			graphics.drawEllipse(o,o,unscaledWidth,unscaledHeight);
			if(f != null)
			{
				f.end(graphics);
			}
			
			
		}
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -