flex-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bigosma...@apache.org
Subject [01/48] git commit: [flex-sdk] [refs/heads/iso7skins] - FLEX-34213 - allow adjustment of maxDragRate (patch contributed by 'after24')
Date Sat, 22 Nov 2014 01:00:44 GMT
Repository: flex-sdk
Updated Branches:
  refs/heads/iso7skins 965d6d194 -> d7b993aa2


FLEX-34213 - allow adjustment of maxDragRate (patch contributed by 'after24')

Replaced the private static const MAX_DRAG_RATE by the public static property maxDragRate.
This allows the value to be manually set to > 30, smoothing the apparent performace of
mobile lists.

Note: the patch suggested a default value of 90; I decided to keep the previous default of
30, in order to minimise the chance of side effects.
Signed-off-by: Erik de Bruin <erik@ixsoftware.nl>


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

Branch: refs/heads/iso7skins
Commit: 105ae47b3e46420044b1116370c77e2982cf8c63
Parents: 4396efe
Author: Erik de Bruin <erik@ixsoftware.nl>
Authored: Mon Oct 6 09:50:18 2014 +0200
Committer: Erik de Bruin <erik@ixsoftware.nl>
Committed: Mon Oct 6 09:50:18 2014 +0200

----------------------------------------------------------------------
 .../spark/src/spark/components/Scroller.as      | 46 +++++++++++++++-----
 1 file changed, 35 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flex-sdk/blob/105ae47b/frameworks/projects/spark/src/spark/components/Scroller.as
----------------------------------------------------------------------
diff --git a/frameworks/projects/spark/src/spark/components/Scroller.as b/frameworks/projects/spark/src/spark/components/Scroller.as
index fb18a56..3ca9155 100644
--- a/frameworks/projects/spark/src/spark/components/Scroller.as
+++ b/frameworks/projects/spark/src/spark/components/Scroller.as
@@ -519,13 +519,6 @@ public class Scroller extends SkinnableComponent
     
     /**
      *  @private
-     *  Maximum number of times per second we will change the scroll position 
-     *  and update the display while dragging.
-     */
-    private static const MAX_DRAG_RATE:Number = 30;
-    
-    /**
-     *  @private
      *  The name of the viewport's horizontal scroll position property
      */
     private static const HORIZONTAL_SCROLL_POSITION:String = "horizontalScrollPosition";
@@ -1352,8 +1345,39 @@ public class Scroller extends SkinnableComponent
         }
     }
     
-    
-    
+	//----------------------------------
+	//  maxDragRate
+	//----------------------------------
+	
+	private static var _maxDragRate:Number = 30;
+	
+	[Inspectable(category="General", defaultValue="30")]
+	
+	/**
+	 *
+	 *  Maximum number of times per second the scroll position
+	 *  and the display will be updated while dragging.
+	 *
+	 *  @default 30
+	 *
+	 *  @langversion 3.0
+	 *  @playerversion Flash 10
+	 *  @playerversion AIR 2.5
+	 *  @productversion Flex 4.5
+	 */
+	
+	public static function get maxDragRate():Number
+	{
+		return _maxDragRate;
+	}
+	
+	public static function set maxDragRate(value:Number):void
+	{
+		_maxDragRate = value;
+	}
+	
+	
+	
     //--------------------------------------------------------------------------
     // 
     // Methods
@@ -3328,7 +3352,7 @@ public class Scroller extends SkinnableComponent
                         canScrollHorizontally,
                         canScrollVertically,
                         Math.round(minSlopInches * Capabilities.screenDPI), 
-                        dragEventThinning ? MAX_DRAG_RATE : NaN);
+                        dragEventThinning ? _maxDragRate : NaN);
                     event.stopImmediatePropagation();
                 }
                 else
@@ -3381,7 +3405,7 @@ public class Scroller extends SkinnableComponent
             canScrollHorizontally,
             canScrollVertically,
             Math.round(minSlopInches * Capabilities.screenDPI), 
-            dragEventThinning ? MAX_DRAG_RATE : NaN);
+            dragEventThinning ? _maxDragRate : NaN);
     }
     	
     /**


Mime
View raw message