I suppose it would be ok.  Note that the backing variables
(_horizontalScrollPosition and _verticalScrollPosition are mx_internal which
means that a subclass or helper class is sometimes setting those values
directly, bypassing the setter, so it might not solve the problem.

Was there a bug with a stack trace that showed the setters in them?


On 5/4/13 11:37 PM, "Harbs" <harbs.li...@gmail.com> wrote:

> Makes sense to me. I can't imagine why you'd want a negative scroll value.
> 
> On May 3, 2013, at 7:58 AM, Justin Mclean wrote:
> 
>> 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
>> 
> 

-- 
Alex Harui
Flex SDK Team
Adobe Systems, Inc.
http://blogs.adobe.com/aharui

Reply via email to