flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mamsel...@apache.org
Subject [1/2] git commit: [flex-sdk] [refs/heads/develop] - Fix FLEX-34107 IconItemRenderer separators disappear when using a large font.
Date Mon, 24 Feb 2014 23:14:55 GMT
Repository: flex-sdk
Updated Branches:
  refs/heads/develop 9ab0f42d5 -> a7f40648a


Fix FLEX-34107  IconItemRenderer separators disappear when using a large font.


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

Branch: refs/heads/develop
Commit: d8a36027649722fcd8f636c228bd29a6df9e96f2
Parents: 6942969
Author: mamsellem <maurice.amsellem@systar.com>
Authored: Tue Feb 25 00:14:00 2014 +0100
Committer: mamsellem <maurice.amsellem@systar.com>
Committed: Tue Feb 25 00:14:00 2014 +0100

----------------------------------------------------------------------
 .../src/spark/components/LabelItemRenderer.as   | 26 +++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/d8a36027/frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as
b/frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as
index 97ab8ee..00c1328 100644
--- a/frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as
+++ b/frameworks/projects/mobilecomponents/src/spark/components/LabelItemRenderer.as
@@ -329,6 +329,23 @@ public class LabelItemRenderer extends UIComponent
      *  Whether or not we're the last element in the list
      */
     mx_internal var isLastItem:Boolean = false;
+
+    private var _useOpaqueBackground: Boolean = true;
+
+    /**
+     * Option to use an opaqueBackground property for this renderer. This can improve scrolling
speed.
+     * Since opaqueBackground adds  space around the text proportional to the font's size,
+     * you might need to turn it off when using large fonts to avoid background overflow.
+     * @default  true
+     */
+    public function get useOpaqueBackground(): Boolean {
+        return _useOpaqueBackground;
+    }
+
+    public function set useOpaqueBackground(value: Boolean): void {
+        _useOpaqueBackground = value;
+        invalidateDisplayList();
+    }
     
     //--------------------------------------------------------------------------
     //
@@ -892,13 +909,14 @@ public class LabelItemRenderer extends UIComponent
 		{
 			// If our background is a solid color, use it as the opaqueBackground property
 			// for this renderer. This makes scrolling considerably faster.
-			opaqueBackgroundColor = backgroundColor;
+            if (_useOpaqueBackground)
+			     opaqueBackgroundColor = backgroundColor;
 		}
 
         // Draw the separator for the item renderer
         drawBorder(unscaledWidth, unscaledHeight);
-        
-		opaqueBackground = opaqueBackgroundColor;
+
+		opaqueBackground =  opaqueBackgroundColor;
     }
     
     /**
@@ -1178,5 +1196,7 @@ public class LabelItemRenderer extends UIComponent
         down = (interactionStateDetector.state == InteractionState.DOWN);
         hovered = (interactionStateDetector.state == InteractionState.OVER);
     }
+
+
 }
 }
\ No newline at end of file


Mime
View raw message