You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by ah...@apache.org on 2014/11/25 19:09:05 UTC

[1/2] git commit: [flex-sdk] [refs/heads/develop] - FLEX-34644. DataGrid background was too big

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 <ah...@apache.org>
Authored: Tue Nov 25 08:20:11 2014 -0800
Committer: Alex Harui <ah...@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


[2/2] git commit: [flex-sdk] [refs/heads/develop] - re-fix FLEX-34644. Wasn't handling scrolling correctly

Posted by ah...@apache.org.
re-fix FLEX-34644.  Wasn't handling scrolling correctly


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

Branch: refs/heads/develop
Commit: d216a697d8da3344de54c79d3d12060e396dfb96
Parents: 1b69551
Author: Alex Harui <ah...@apache.org>
Authored: Tue Nov 25 10:08:40 2014 -0800
Committer: Alex Harui <ah...@apache.org>
Committed: Tue Nov 25 10:08:40 2014 -0800

----------------------------------------------------------------------
 frameworks/projects/spark/src/spark/components/Grid.as | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/d216a697/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 0bb0d46..d327377 100644
--- a/frameworks/projects/spark/src/spark/components/Grid.as
+++ b/frameworks/projects/spark/src/spark/components/Grid.as
@@ -5925,6 +5925,7 @@ public class Grid extends Group implements IDataGridElement, IDataProviderEnhanc
         }
     }
     
+    
     /**
      *  @private
      *  Renders a background for the container, if necessary.  It is used to fill in
@@ -5935,7 +5936,8 @@ public class Grid extends Group implements IDataGridElement, IDataProviderEnhanc
      * 
      *  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.
+     *  which causes the GroupBase logic to go down the wrong path.  It also always positions at 0,0
+     *  because the grid itself doesn't scroll, it scrols the layers
      */
     override mx_internal function drawBackground():void
     {
@@ -5951,7 +5953,7 @@ public class Grid extends Group implements IDataGridElement, IDataProviderEnhanc
         graphics.clear();
         graphics.beginFill(0xFFFFFF, 0);
         
-        graphics.drawRect(horizontalScrollPosition, verticalScrollPosition, w, h);
+        graphics.drawRect(0, 0, w, h);
         
         graphics.endFill();
     }