Should use the set minimum for these!

This commit is contained in:
BenDol 2014-07-13 02:08:33 +12:00
parent d070711409
commit 2ada93db9c
2 changed files with 6 additions and 4 deletions

View File

@ -111,7 +111,8 @@ function UIScrollArea:onMouseWheel(mousePos, mouseWheel)
return false
end
if mouseWheel == MouseWheelUp then
if self.verticalScrollBar:getValue() < 1 then
local minimum = self.verticalScrollBar:getMinimum()
if self.verticalScrollBar:getValue() < minimum then
return false
end
self.verticalScrollBar:decrement()
@ -133,7 +134,8 @@ function UIScrollArea:onMouseWheel(mousePos, mouseWheel)
end
self.horizontalScrollBar:increment()
else
if self.horizontalScrollBar:getValue() < 1 then
local minimum = self.horizontalScrollBar:getMinimum()
if self.horizontalScrollBar:getValue() < minimum then
return false
end
self.horizontalScrollBar:decrement()

View File

@ -239,7 +239,7 @@ function UIScrollBar:onMouseWheel(mousePos, mouseWheel)
end
if mouseWheel == MouseWheelUp then
if self.orientation == 'vertical' then
if self.value < 1 then return false end
if self.value <= self.minimum then return false end
self:decrement()
else
if self.value >= self.maximum then return false end
@ -250,7 +250,7 @@ function UIScrollBar:onMouseWheel(mousePos, mouseWheel)
if self.value >= self.maximum then return false end
self:increment()
else
if self.value < 1 then return false end
if self.value <= self.minimum then return false end
self:decrement()
end
end