Important fix to uiscrollarea

I messed up the code and forgot to commit this.
->Check if function is set before calling it here.
This commit is contained in:
Samuel 2012-10-06 05:56:38 +02:00 committed by otfallen
parent 5756f20026
commit f0e9cf070e
1 changed files with 2 additions and 2 deletions

View File

@ -71,7 +71,7 @@ function UIScrollArea:setVerticalScrollBar(scrollbar)
local virtualOffset = self:getVirtualOffset()
virtualOffset.y = value
self:setVirtualOffset(virtualOffset)
self:onScrollbarChange(value) -- Maybe there is a better way to do this?
if self.onScrollbarChange then self:onScrollbarChange(value) end
end
self:updateScrollBars()
end
@ -82,7 +82,7 @@ function UIScrollArea:setHorizontalScrollBar(scrollbar)
local virtualOffset = self:getVirtualOffset()
virtualOffset.x = value
self:setVirtualOffset(virtualOffset)
self:onScrollbarChange(value) -- Maybe there is a better way to do this?
if self.onScrollbarChange then self:onScrollbarChange(value) end
end
self:updateScrollBars()
end