📄 ellipse.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 + -