lundi 30 novembre 2015

Flex - corner is not working properly

I am using numeric stepper to give the corner and weight of rectangle.

<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" joints="miter"  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"/>

corner and weight working fine separately. Now I am giving maximum value 100 to weight and the minimum value 0 to corer. The output will be like

enter image description here

when I am trying to increase the corner to 1, it's working like

enter image description here

I am giving the corner value as 1. But the rectangle corner looking like more than 50. I don't know what is the problem.

Anybody can find my mistake?

Thank you

Aucun commentaire:

Enregistrer un commentaire