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)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • Adobe Flex SDK Previous
    • Adobe Flex SDK Previous
    • Flash Integration
    • None
    • 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

            adobejira Adobe JIRA
            adobejira Adobe JIRA
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: