mirror of
https://github.com/linux-man/LoveFrames.git
synced 2024-11-26 05:14:21 +00:00
Fix bug that would cause tabbuttons to be positioned incorrectly when scrolling with the mouse wheel
This commit is contained in:
parent
1764333ae4
commit
0472742468
@ -239,17 +239,16 @@ function newobject:mousepressed(x, y, button)
|
|||||||
local visible = internals[numinternals]:GetVisible()
|
local visible = internals[numinternals]:GetVisible()
|
||||||
if col and visible then
|
if col and visible then
|
||||||
local bwidth = self:GetWidthOfButtons()
|
local bwidth = self:GetWidthOfButtons()
|
||||||
if (self.offsetx + bwidth) < self.width then
|
local scrollamount = self.mousewheelscrollamount
|
||||||
self.offsetx = bwidth - self.width
|
local dtscrolling = self.dtscrolling
|
||||||
|
if dtscrolling then
|
||||||
|
local dt = love.timer.getDelta()
|
||||||
|
self.offsetx = self.offsetx - scrollamount * dt
|
||||||
else
|
else
|
||||||
local scrollamount = self.mousewheelscrollamount
|
self.offsetx = self.offsetx - scrollamount
|
||||||
local dtscrolling = self.dtscrolling
|
end
|
||||||
if dtscrolling then
|
if ((self.offsetx + bwidth) + self.width) < self.width then
|
||||||
local dt = love.timer.getDelta()
|
self.offsetx = -(bwidth + 10)
|
||||||
self.offsetx = self.offsetx - scrollamount * dt
|
|
||||||
else
|
|
||||||
self.offsetx = self.offsetx - scrollamount
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user