/[Apache-SVN]
ViewVC logotype

Revision 1290745


Jump to revision: Previous Next
Author: (unknown author)
Date: Thu Feb 2 20:35:43 2012 UTC (12 years, 1 month ago)
Changed paths: 1
Log Message:
Transferred from the Adobe Open Source Subversion Repository

Revision: 7319
Author:   jszeto@adobe.com
Date:     2009-05-27T17:45:33.641648Z

Log Message: 
-----------
Transform improvements

http://bugs.adobe.com/jira/browse/SDK-17312 - Fix up transform, matrix and matrix3D properties on UIComponent and GraphicElement. 

When a Transform is assigned to a GraphicElement or UIComponent, we want changes to the Transform to be applied to the GraphicElement or UIComponent (component). The current implementation has the component listening for change events on the Transform. We also want the Transform to reflect changes made to the component. The current implementation doesn’t do this. 

The solution is when the Transform is assigned to the component, that component is assigned to the target property of the Transform. Any calls to the setters of the Transform directly assign properties of the component. The getters grab their values directly from the component. The components no longer listen for change events from the Transform. 

Since the GraphicElement and IGraphicElement classes exist in the flex4 swc, they can not be used in the Transform class, which exists only in the framework swc. The solution is to use loose typing and use the “property in object” check. The change to the component classes are made in UIComponent, UIMovieClip and GraphicElement. 

I added a public $transform property to UIMovieClip to access super.transform. I had to make it public because the framework swc doesn’t include UIMovieClip. 

I was unable to override the matrix3D setter in Transform because it was throwing an illegal override compiler error. 

I had to add a setColorTransform public function to GraphicElement to handle the case where the GraphicElement’s colorTransform is directly set. 

myRect.transform.colorTransform = newColorTransform;

In this situation, the GraphicElement’s transform object is created on demand. At this point, the GraphicElement might not have its own DisplayObject, so we need a way to store the colorTransform value until the DO is created. I had to make the function public because the “in” operator doesn’t work with non-public namespaces. 

ColorTransforms get passed around by reference, so in setColorTransform, I make a copy. This fixes some strange baseColor bug I was seeing. 


http://bugs.adobe.com/jira/browse/SDK-17680 - GraphicElement with transform matrix ignores alpha property

If the alpha property and a transform are declaratively set on a GraphicElement, then the alpha value is ignored. The reason is that the Transform object always has a default value for its ColorTransform, which sets the alpha value. The transform.ColorTransform.alphaMultiplier and alpha property are synchronized in DisplayObject. 

Ideally we would throw a compiler error if both the alpha property and the transform property were set at the same time. Instead, the next best thing to do is to apply the alpha value after the ColorTransform has been applied. We can do this for GraphicElement since alpha and colorTransform are set in commitProperties. For UIComponent, alpha is applied right away. I didn’t want to change that since it would probably break a whole lot of mustella tests and effect behavior. Thus this bug still exists in UIComponent. 

QE Notes: Need tests to ensure that the Transform is in sync with its target component
Doc Notes: Need to document that changes to the component get reflected by its Transform 
Bugs: SDK-17312, SDK-17680
Reviewer: Glenn

Modified Paths:
--------------
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flex4/src/spark/primitives/supportClasses/GraphicElement.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/spark-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/geom/Transform.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/halo-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/flash-integration/src/mx/flash/UIMovieClip.as</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/fxg-manifest.xml</path>
<path kind="file" action="M">/flex/sdk/trunk/frameworks/projects/framework/src/mx/core/UIComponent.as</path>

Changed paths

Path Details
Directoryincubator/flex/trunk/frameworks/spark-manifest.xml modified , text changed

infrastructure at apache.org
ViewVC Help
Powered by ViewVC 1.1.26