Uploaded image for project: 'Apache Flex'
  1. Apache Flex
  2. FLEX-21571

UIMovieClip deals with post-transform width/height (inconsistent with other Flex 4 components/graphics)

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: Adobe Flex SDK Previous
    • Fix Version/s: Adobe Flex SDK Previous
    • Component/s: Flash Integration
    • Labels:
      None
    • Environment:
      Affected OS(s): All OS Platforms
      Language Found: English

      Description

      Steps to reproduce:
      1. Run code below (put attached image and class in same folder)
      2. click on button
      3. click on UIMovieClip (has icon in it)

      Actual Results:
      Button was set with width/height 50/50, but scale factor .5/.5. It reports back these exact values, but has an onscreen size of 25/25. This means that the width/height you set (and that it reports) is pre-transform.
      Meanwhile, the UIMovieClip was set with width/height 50/50. Internally, it sets a transform scale factor of .331/.331 because the intrinsic size of the object is 151, 151. It reports external scaleX/scaleY values of 1,1, which is correct since the app didn't set them, but internally it has a scale factor applied.
      However, the reported width/height are post transform.
      This is messing with our assumptions elsewhere in the SDK, where we measure the width/height expecting pre-transform, and we get results back that are post-transform, causing incorrect calculations. (For example, the effects code uses width/height to determine the local transform center, but the transform center is post-transform, and we end up rotating around the wrong point).

      Expected Results:
      Should use pre-transform width/height

      Here's the code:
      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:mx="library://ns.adobe.com/flex/halo" xmlns:local="*">
      <s:Button x="150" y="60" id="button" width="50" height="50" scaleX=".5" scaleY=".5"
      click="trace('button w, h, sx, sy = ' + button.width +', ' + button.height + ', ' + button.scaleX + ', ' + button.scaleY)"/>
      <local:FlashComponentPlaceholder x="350" y="60" id="uimc1" width="50" height="50"
      click="trace('movieclip w, h, sx, sy = ' + uimc1.width +', ' + uimc1.height + ', ' + uimc1.scaleX + ', ' + uimc1.scaleY)"/>
      </s:Application>

        Attachments

          Activity

            People

            • Assignee:
              adobejira Adobe JIRA
              Reporter:
              adobejira Adobe JIRA

              Dates

              • Created:
                Updated:
                Resolved:

                Issue deployment