When reaching max or min scroll allow other scroll areas to scroll.

This commit is contained in:
BenDol
2014-07-13 02:06:36 +12:00
parent 5909634837
commit d070711409
2 changed files with 19 additions and 1 deletions

View File

@@ -234,19 +234,23 @@ function UIScrollBar:onGeometryChange()
end
function UIScrollBar:onMouseWheel(mousePos, mouseWheel)
if not self.mouseScroll then
if not self.mouseScroll or not self:isOn() then
return false
end
if mouseWheel == MouseWheelUp then
if self.orientation == 'vertical' then
if self.value < 1 then return false end
self:decrement()
else
if self.value >= self.maximum then return false end
self:increment()
end
else
if self.orientation == 'vertical' then
if self.value >= self.maximum then return false end
self:increment()
else
if self.value < 1 then return false end
self:decrement()
end
end