You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flex.apache.org by er...@apache.org on 2014/10/06 09:50:34 UTC

git commit: [flex-sdk] [refs/heads/develop] - FLEX-34213 - allow adjustment of maxDragRate (patch contributed by 'after24')

Repository: flex-sdk
Updated Branches:
  refs/heads/develop 4396efe49 -> 105ae47b3


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 <er...@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/develop
Commit: 105ae47b3e46420044b1116370c77e2982cf8c63
Parents: 4396efe
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Mon Oct 6 09:50:18 2014 +0200
Committer: Erik de Bruin <er...@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);
     }
     	
     /**