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

BitmapImage.scaleMode="zoom" does not always center vertically

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: Adobe Flex SDK 4.6 (Release)
    • Fix Version/s: None
    • Component/s: Spark: Image
    • Labels:
    • Environment:
      Affected OS(s): All OS Platforms
      Affected OS(s): All OS Platforms
      Language Found: English

      Description

      Steps to reproduce:
      1. Set scaleMode="zoom" and fillMode="scale" on a spark Image or BitmapImage

      Actual Results:
      Some images will not be centered vertically, even when verticalAlign="middle" (the default)

      Workaround (if any):
      I believe the problem is in spark.primitives.BitmapImage updateDisplayList() line #1202

      if (isZoom)

      { if (cWidth > unscaledWidth) translateX = translateX + ((unscaledWidth - cWidth) * getHorizontalAlignValue()); else if (cHeight > unscaledHeight) translateY = translateY + ((unscaledHeight - cHeight) * getVerticalAlignValue()); }

      I believe the "else if" should be just an "if". Because everywhere else in the updateDisplayList() method where getHorizontalAlignValue() or getVerticalAlignValue() is being called, it is always 2 if statements, never a single if...else statement.

      On my image, these were the values when it would not vertically center correctly:

      b.height = 239
      b.width = 225
      cHeight = 987.8666666666668
      cWidth = 930.0000000000001
      unscaledWidth = 930
      unscaledHeight = 455

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              adobejira Adobe JIRA
            • Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: