希望有人能帮上忙。我有一个Flex (4.5/Air)应用程序,它的图形声明如下:
<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" >
<s:fill>
<s:SolidColor color="#FFFFFF"/>
</s:fill>
</s:Ellipse>
</s:Graphic>当我以编程方式调整图形大小时,它也会缩放边框(Rect)和椭圆(upperLeftHandle)。我需要调整图形对象的大小,但Rect和Ellipse (以及图形中的任何其他内容)保持相同的比例。
有谁有什么想法吗?
发布于 2011-06-06 18:00:52
您必须像这样使用Eclipse
<s:Ellipse id="upperLeftHandle" height="8" width="8" x="-2" y="-2" >希望它能解决你的问题
发布于 2011-06-11 02:17:29
有没有什么特别的原因需要使用这个图形标签?使用Group标记将允许您获得所需的定位和调整大小的功能。只要你只是改变组的宽度和高度,你就不会有缩放的问题。
<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>https://stackoverflow.com/questions/6240263
复制相似问题