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 11:59:56 UTC
git commit: [flex-sdk] [refs/heads/origin/iso7skins] - FLEX-34213 -
allow adjustment of maxDragRate (patch contributed by 'after24')
Repository: flex-sdk
Updated Branches:
refs/heads/origin/iso7skins [created] 1124de923
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/1124de92
Tree: http://git-wip-us.apache.org/repos/asf/flex-sdk/tree/1124de92
Diff: http://git-wip-us.apache.org/repos/asf/flex-sdk/diff/1124de92
Branch: refs/heads/origin/iso7skins
Commit: 1124de923d6c02e98634c58762f5d305b1f7d9a6
Parents: e6f0395
Author: Erik de Bruin <er...@ixsoftware.nl>
Authored: Mon Oct 6 09:46:46 2014 +0200
Committer: Erik de Bruin <er...@ixsoftware.nl>
Committed: Mon Oct 6 09:46:53 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/1124de92/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);
}
/**