shadow properties

This commit is contained in:
airstruck
2015-11-02 23:38:51 -05:00
parent f436093380
commit 997f9c8d12
103 changed files with 88 additions and 62 deletions

View File

@@ -29,10 +29,8 @@ return function (self)
local key = event.key
if key == 'left' or key == 'down' then
self:setValue(clamp(self.value - self.step))
self:reshape()
elseif event.key == 'right' or key == 'up' then
self:setValue(clamp(self.value + self.step))
self:reshape()
end
end)
@@ -41,7 +39,6 @@ return function (self)
local halfThumb = thumb:getWidth() / 2
x1, x2 = x1 + halfThumb, x2 - halfThumb
self:setValue(clamp((event.x - x1) / (x2 - x1)))
self:reshape()
self.layout:tryFocus(thumb)
end
@@ -56,6 +53,10 @@ return function (self)
thumb.hovered = false
end)
self:onChange(function (event)
self:reshape()
end)
self:onReshape(function (event)
local x1, y1, x2, y2 = self:getRectangle(true, true)
local halfThumb = thumb:getWidth() / 2