mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-18 16:04:22 +00:00
Fixed a bug that allowed tab buttons to potentially be scrolled infinitely
This commit is contained in:
parent
5877855d4e
commit
27fd2d3634
@ -38,7 +38,7 @@ end
|
||||
function tabs:update(dt)
|
||||
|
||||
local x, y = love.mouse.getPosition()
|
||||
local tabheight = self.tabheight
|
||||
local tabheight = self.tabheight
|
||||
local padding = self.padding
|
||||
local autosize = self.autosize
|
||||
local tabheight = self.tabheight
|
||||
@ -160,6 +160,9 @@ function tabs:mousepressed(x, y, button)
|
||||
|
||||
if col == true and visible == true then
|
||||
self.offsetx = self.offsetx + 5
|
||||
if self.offsetx > 0 then
|
||||
self.offsetx = 0
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
@ -172,6 +175,10 @@ function tabs:mousepressed(x, y, button)
|
||||
|
||||
if col == true and visible == true then
|
||||
self.offsetx = self.offsetx - 5
|
||||
local bwidth = self:GetWidthOfButtons()
|
||||
if (self.offsetx + bwidth) < self.width then
|
||||
self.offsetx = bwidth - self.width
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user