SolidColorStroke - caps属性不起作用

时间:2015-11-27 13:49:17

标签: actionscript-3 flex4

我正在尝试为矩形设置角落和重量

<fx:Script>
    <![CDATA[
        protected function weight_changeHandler(event:Event):void
        {
            borderStroke.weight = wght.value;
        }           
        protected function corner_changeHandler(event:Event):void
        {
            border.topLeftRadiusX= border.bottomLeftRadiusX =border.topRightRadiusX=border.bottomRightRadiusX=corner.value;
        }           
    ]]>
</fx:Script>

<s:layout >
    <s:VerticalLayout paddingLeft="50" paddingTop="50"/>
</s:layout>
<s:Rect horizontalCenter="0" verticalCenter="0" height="300" width="300" id="border">
    <s:stroke>
        <s:SolidColorStroke id="borderStroke" color="#000000" caps="square" weight="1" alpha="1"/>
    </s:stroke>
</s:Rect>
<s:NumericStepper id="wght" change="weight_changeHandler(event)" maximum="100"/>
<s:NumericStepper id="corner" change="corner_changeHandler(event)" maximum="100"/>

当我增加体重时,矩形角也在变化。我是这样的 enter image description here

任何人都可以告诉我我错过了什么?我的错是什么?

1 个答案:

答案 0 :(得分:3)

您只需将JointStylejoints参数)设置为JointStyle.MITERmiter):

<s:SolidColorStroke id="borderStroke" color="#000000" caps="square" joints="miter" weight="1" alpha="1"/>
希望能有所帮助。

enter image description here