flex-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mario Ade (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (FLEX-29004) BitmapImage.scaleMode="zoom" does not always center vertically
Date Mon, 24 Mar 2014 17:32:45 GMT

    [ https://issues.apache.org/jira/browse/FLEX-29004?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13945394#comment-13945394
] 

Mario Ade edited comment on FLEX-29004 at 3/24/14 5:32 PM:
-----------------------------------------------------------

Still happening in flex 4.12. It happens frequently for me when I use images from twitter
(twimg) with small tag (:small) with the Image displaying in landscape size. It shows the
top part of the image instead of the middle of it.


was (Author: tardcutt):
It happens frequently for me when I use images from twitter (twimg) with small tag (:small)
with the Image displaying in landscape size. It shows the top part of the image instead of
the middle of it.

> 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 was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message