| <?xml version="1.0" encoding="utf-8"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| |
| --> |
| <s:Module xmlns:fx="http://ns.adobe.com/mxml/2009" |
| xmlns:s="library://ns.adobe.com/flex/spark" |
| xmlns:mx="library://ns.adobe.com/flex/halo" minWidth="1024" minHeight="768"> |
| <s:layout> |
| <s:BasicLayout/> |
| </s:layout> |
| |
| <fx:Script> |
| <![CDATA[ |
| |
| private function addMatrix(): void |
| { |
| ellipse1.transform.matrix = rotation20Matrix; |
| descriptionText.text = "A matrix transform was applied moving the Ellipse to coordinates: 100, 310 and skewing it to a 20 degree rotation."; |
| trace(ellipse1.width); |
| } |
| ]]> |
| </fx:Script> |
| <fx:Declarations> |
| <!-- This matrix should cause the rotation of the Ellipse be 20 degrees --> |
| <s:Matrix id="rotation20Matrix" |
| a="0.939692620786" |
| b="0.34202014332" |
| c="0.34202014332" |
| d="0.939692620786" |
| tx="50" |
| ty="210" |
| /> |
| </fx:Declarations> |
| |
| <s:Panel title="Ellipse Transform Sample" width="100%" height="100%"> |
| <s:layout> |
| <s:VerticalLayout paddingLeft="10" paddingRight="10" paddingTop="10" paddingBottom="10"/> |
| </s:layout> |
| |
| <s:Label text="An Ellipse Using a Transform for Rotation" /> |
| |
| <s:Label id="descriptionText" width="300"/> |
| <s:Button label="Apply Transform" click="addMatrix()" x="40" y="330" /> |
| </s:Panel> |
| <s:Ellipse id="ellipse1" width="60" height="70" x="40" y="120"> |
| <s:fill> |
| <s:LinearGradient> |
| <s:GradientEntry color="#00FF00" alpha="1" ratio="0"/> |
| <s:GradientEntry color="#000000" alpha="0" ratio="1"/> |
| </s:LinearGradient> |
| </s:fill> |
| <s:stroke> |
| <s:SolidColorStroke color="0x666666" weight="1"/> |
| </s:stroke> |
| </s:Ellipse> |
| </s:Module> |