flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Mclean <jus...@classsoftware.com>
Subject negative scroll values in mx components
Date Fri, 03 May 2013 04:58:56 GMT
Hi,

There's a few JIRA bugs in the mx datagrids, advanced datagrids and lists related to negative
scroll values.

What do people think of this patch to stop the issue from occurring at all?

diff --git a/frameworks/projects/mx/src/mx/core/ScrollControlBase.as b/frameworks/projects/mx/src/mx/core/ScrollControlBase.as
index 5ab99da..f35a7ba 100644
--- a/frameworks/projects/mx/src/mx/core/ScrollControlBase.as
+++ b/frameworks/projects/mx/src/mx/core/ScrollControlBase.as
@@ -493,6 +493,9 @@ public class ScrollControlBase extends UIComponent
      */
     public function set horizontalScrollPosition(value:Number):void
     {
+		if (value < 0)
+			value = 0;
+			
         _horizontalScrollPosition = value;
 
         if (horizontalScrollBar)
@@ -828,7 +831,10 @@ public class ScrollControlBase extends UIComponent
      */
     public function set verticalScrollPosition(value:Number):void
     {
+        if (value < 0)
+			value = 0;
+		
	_verticalScrollPosition = value;
 
         if (verticalScrollBar)
             verticalScrollBar.scrollPosition = value;

Thanks,
Justin


Mime
View raw message