0 Replies Latest reply on Jan 21, 2009 4:58 PM by Jason Szeto

    [svn] 4612: Flex SDK Bug Fix - Added scaleGrid support to BitmapGraphic

    Jason Szeto Level 3
      Revision: 4612
      Author: jszeto@adobe.com
      Date: 2009-01-21 16:58:51 -0800 (Wed, 21 Jan 2009)

      Log Message:
      -----------
      Flex SDK Bug Fix - Added scaleGrid support to BitmapGraphic

      SDK-17289 - BitmapGraphic source embed does not respect scale9 grid when scaling

      BitmapGraphic will use the scaleGrid properties defined on its embedded source. Since the Player doesn't support scaleGrid on bitmaps, we have to slice the bitmap into nine sections and then scale/translate each section. We create two arrays of points along the grid. These are used to define the topLeft and bottomRight corners of the section. Based on the internal scaleFactor and which section we are in, we draw a scaled and translated section according to the scaleGrid rules.

      More details:
      - Changed BitmapGraphic to no longer use the BitmapFill to draw. Instead, BitmapGraphic performs the drawing code itself.
      - When the source is set, check if it has scaleGrid properties and store these in internal variable
      - Cache the creation of the 16 grid points array. Flush the cache if the source or dimensions have changed
      - To see this behavior in action, set width/height to different values than the source's natural dimensions and set resizeMode = "scale"

      QE Notes: Add tests for BitmapGraphic with embedded assets using scaleGrid
      Doc Notes: Add docs for this functionality
      Bugs: SDK-17289
      Reviewer: Glenn

      Ticket Links:
      ------------
      http://bugs.adobe.com/jira/browse/SDK-17289
      http://bugs.adobe.com/jira/browse/SDK-17289

      Modified Paths:
      --------------
      flex/sdk/trunk/frameworks/projects/flex4/src/mx/graphics/BitmapGraphic.as