如何在Flex(View Box)中将路径缩放到容器? [英] How do I make the path scale to the container in Flex (View Box)?

查看:181
本文介绍了如何在Flex(View Box)中将路径缩放到容器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下标记:

I have the following markup:

<s:Group width="100%" height="100%"> 
    <s:BorderContainer borderWeight="3" borderColor="black" cornerRadius="5" width="100%" height="100%">
        <s:Path> 
            <s:stroke>
                <s:SolidColorStroke color="black" />
            </s:stroke>
            <s:data>M 14.153 14.788 C 13.856 15.25 13.161 15.628 12.612 15.628 L 0.766 15.628 C 0.216 15.628 -0.028 15.228 0.225 14.739 L 3.307 8.765 C 3.56 8.276 3.56 7.477 3.307 6.988 L 0.225 1.014 C -0.028 0.525 0.216 0.125 0.766 0.125 L 12.612 0.125 C 13.161 0.125 13.856 0.503 14.153 0.965 L 18.07 7.036 C 18.367 7.499 18.367 8.254 18.07 8.717 L 14.153 14.788 Z</s:data>
        </s:Path>
    </s:BorderContainer>
</s:Group>



我想调整基于在容器上在此容器的路径。在SVG和Silverlight中,有一个ViewBox的概念,但我无法在Flex中找到这个概念。

I want the path in this container to resize based on the container. In SVG and Silverlight, there is the concept of "ViewBox" but I can't find that concept in Flex.

将宽度和高度设置为100%但是当你有很多路径的时候,它需要很多修补。另外,它的行为并不像你想要的那样(尝试一下,调整你的浏览器的大小)。

Setting the width and height to 100% kind of works, but it requires a lot of tinkering when you have a lot of paths. Plus, it doesn't behave exactly like you would want (try it out and resize your browser)

正在寻找。 AutoFitArea正是我想要的:

I found what I was looking for. AutoFitArea does exactly what I want:

http:// www.greensock.com/autofitarea/

这篇关于如何在Flex(View Box)中将路径缩放到容器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆