You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@flex.apache.org by "Alex Harui (JIRA)" <ji...@apache.org> on 2012/11/05 20:38:12 UTC
[jira] [Updated] (FLEX-29004) BitmapImage.scaleMode="zoom" does not
always center vertically
[ https://issues.apache.org/jira/browse/FLEX-29004?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Alex Harui updated FLEX-29004:
------------------------------
Labels: EasyFix (was: )
Summary: BitmapImage.scaleMode="zoom" does not always center vertically (was: [ForCommunity] BitmapImage.scaleMode="zoom" does not always center vertically)
> BitmapImage.scaleMode="zoom" does not always center vertically
> --------------------------------------------------------------
>
> Key: FLEX-29004
> URL: https://issues.apache.org/jira/browse/FLEX-29004
> Project: Apache Flex
> Issue Type: Bug
> Components: Spark: Image
> Affects Versions: Adobe Flex SDK 4.6 (Release)
> Environment: Affected OS(s): All OS Platforms
> Affected OS(s): All OS Platforms
> Language Found: English
> Reporter: Adobe JIRA
> Labels: EasyFix
>
> 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
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira