mirror of
https://github.com/airstruck/luigi.git
synced 2025-12-19 02:16:43 +00:00
cleanup, docs
This commit is contained in:
@@ -17,19 +17,19 @@ return function (self)
|
||||
axis = 'y'
|
||||
dimension = 'height'
|
||||
end
|
||||
local prevSibling = self:getPrevious()
|
||||
local nextSibling = self:getNext()
|
||||
local prevSibling = self:getPreviousSibling()
|
||||
local nextSibling = self:getNextSibling()
|
||||
local prevSize = prevSibling and prevSibling[dimension]
|
||||
local nextSize = nextSibling and nextSibling[dimension]
|
||||
|
||||
if prevSize then
|
||||
prevSibling:setDimension(dimension,
|
||||
event[axis] - prevSibling:calculatePosition(axis))
|
||||
event[axis] - prevSibling:calculatePosition(axis))
|
||||
end
|
||||
if nextSize then
|
||||
nextSibling:setDimension(dimension,
|
||||
nextSibling:calculatePosition(axis) +
|
||||
nextSibling:calculateDimension(dimension) - event[axis])
|
||||
nextSibling:calculatePosition(axis) +
|
||||
nextSibling:calculateDimension(dimension) - event[axis])
|
||||
end
|
||||
|
||||
end)
|
||||
|
||||
@@ -39,7 +39,7 @@ return function (self)
|
||||
local halfThumb = thumb:getWidth() / 2
|
||||
x1, x2 = x1 + halfThumb, x2 - halfThumb
|
||||
self:setValue(clamp((event.x - x1) / (x2 - x1)))
|
||||
self.layout:tryFocus(thumb)
|
||||
thumb:focus()
|
||||
end
|
||||
|
||||
self:onPressStart(press)
|
||||
|
||||
Reference in New Issue
Block a user