开发者

Stop spark Graphic children from scaling FlexBuilder4.5

Hope someone can help. I have a Flex (4.5/Air) app that has a graphic declared like this :

<s:Graphic id="viewRect" width="200" height="200">
   <s:Rect id="border" width="200" height="200"> 
    <s:stroke >
        <s:SolidColorStroke  weight="1"  color="#606060" />
    </s:stroke>
   </s:Rect>

   <s:Ellipse id="upperLeftHandle" height="8" width="8" left="-2" top="-2" >
   <开发者_StackOverflow中文版s:fill>
     <s:SolidColor color="#FFFFFF"/>
       </s:fill>
    </s:Ellipse> 
</s:Graphic>

When I resize the Graphic programatically, it also scales the border (Rect) as well as the Ellipse (upperLeftHandle). I need to resize the graphic object, but have the Rect and Ellipse (and anything else inside the Graphic) remain the same scale.

Anyone have any ideas?


you have to use Eclipse like this

<s:Ellipse id="upperLeftHandle" height="8" width="8" x="-2" y="-2" >

hope it would solve your problem


Is there a specific reason you need to use the graphics tag? Using the Group tag will allow you the positioning and re-sizing capabilities that you need. As long are you are only changing the width and height of the group you will be fine and not have the scaling issues.

<s:Group id="viewRect" width="200" height="200">
    <s:Rect id="border" left="0" right="0" top="0" bottom="0"> 
        <s:stroke >
            <s:SolidColorStroke weight="1" color="#606060" />
        </s:stroke>
    </s:Rect>

    <s:Ellipse id="upperLeftHandle" height="8" width="8" left="-2" top="-2" >
        <s:fill>
            <s:SolidColor color="#FFFFFF"/>
        </s:fill>
    </s:Ellipse> 
</s:Group>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜