From c911165c4111536d4c0c42724b07572a7adfa097 Mon Sep 17 00:00:00 2001 From: hryx Date: Mon, 25 Mar 2013 23:37:09 -0700 Subject: Tweak Slider style Made a marginally simpler & more readable Slider draw routine using rectangles instead of lines. Also the ends of the slider "track" are capped now. I split this commit in case a rollback is desired. --- style-default.lua | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/style-default.lua b/style-default.lua index 95aecef..91cbd84 100644 --- a/style-default.lua +++ b/style-default.lua @@ -82,24 +82,21 @@ end local function Slider(state, fraction, vertical, x,y,w,h) local c = color[state] - love.graphics.setLine(2, 'rough') - love.graphics.setColor(c.border) + love.graphics.setLine(1, 'rough') + love.graphics.setColor(c.bg) if vertical then - love.graphics.line(x+w/2-1,y,x+w/2-1,y+h) - love.graphics.line(x+w/2+1,y,x+w/2+1,y+h) - love.graphics.setColor(c.bg) - love.graphics.line(x+w/2,y,x+w/2,y+h) + love.graphics.rectangle('fill', x+w/2-2,y,4,h) + love.graphics.setColor(c.border) + love.graphics.rectangle('line', x+w/2-2,y,4,h) y = math.floor(y + h - h * fraction - 5) h = 10 else - love.graphics.line(x,y+h/2-1,x+w,y+h/2-1) - love.graphics.line(x,y+h/2+1,x+w,y+h/2+1) - love.graphics.setColor(c.bg) - love.graphics.line(x,y+h/2,x+w,y+h/2) + love.graphics.rectangle('fill', x,y+h/2-2,w,4) + love.graphics.setColor(c.border) + love.graphics.rectangle('line', x,y+h/2-2,w,4) x = math.floor(x + w * fraction - 5) w = 10 end - box(x,y,w,h, c.bg,c.border) end -- cgit v1.2.3-54-g00ecf