flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aha...@apache.org
Subject [1/2] git commit: [flex-sdk] [refs/heads/develop] - FLEX-34644. DataGrid background was too big
Date Tue, 25 Nov 2014 18:09:05 GMT
Repository: flex-sdk
Updated Branches:
  refs/heads/develop d5f7eb42c -> d216a697d


FLEX-34644.  DataGrid background was too big


Project: http://git-wip-us.apache.org/repos/asf/flex-sdk/repo
Commit: http://git-wip-us.apache.org/repos/asf/flex-sdk/commit/1b69551d
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/1b69551d
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/1b69551d

Branch: refs/heads/develop
Commit: 1b69551d6d0e0115ff2f318ebf9204fbc08379ef
Parents: d5f7eb4
Author: Alex Harui <aharui@apache.org>
Authored: Tue Nov 25 08:20:11 2014 -0800
Committer: Alex Harui <aharui@apache.org>
Committed: Tue Nov 25 08:20:53 2014 -0800

----------------------------------------------------------------------
 .../projects/spark/src/spark/components/Grid.as | 32 ++++++++++++++++++++
 1 file changed, 32 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/1b69551d/frameworks/projects/spark/src/spark/components/Grid.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/components/Grid.as b/frameworks/projects/spark/src/spark/components/Grid.as
index ce87b44..0bb0d46 100644
--- a/frameworks/projects/spark/src/spark/components/Grid.as
+++ b/frameworks/projects/spark/src/spark/components/Grid.as
@@ -5924,5 +5924,37 @@ public class Grid extends Group implements IDataGridElement, IDataProviderEnhanc
             dispatchEvent(caretChangeEvent);
         }
     }
+    
+    /**
+     *  @private
+     *  Renders a background for the container, if necessary.  It is used to fill in
+     *  a transparent background fill as necessary to support the _mouseEnabledWhereTransparent
flag.  It 
+     *  is also used in ItemRenderers when handleBackgroundColor is set to true.
+     *  We assume for now that we are the first layer to be rendered into the graphics
+     *  context.
+     * 
+     *  This is mostly copied from GroupBase, but always chooses the virtualLayout path.
 The Grid's
+     *  layout has useVirtualLayout=false but the Grid's GridView always has useVirtualLayout=true
+     *  which causes the GroupBase logic to go down the wrong path.
+     */
+    override mx_internal function drawBackground():void
+    {
+        if (!mouseEnabledWhereTransparent || !hasMouseListeners)
+            return;
+        
+        var w:Number = (resizeMode == ResizeMode.SCALE) ? measuredWidth : unscaledWidth;
+        var h:Number = (resizeMode == ResizeMode.SCALE) ? measuredHeight : unscaledHeight;
+        
+        if (isNaN(w) || isNaN(h))
+            return;
+        
+        graphics.clear();
+        graphics.beginFill(0xFFFFFF, 0);
+        
+        graphics.drawRect(horizontalScrollPosition, verticalScrollPosition, w, h);
+        
+        graphics.endFill();
+    }
+
 }
 }
\ No newline at end of file


Mime
View raw message