make slider slightly less ugly

This commit is contained in:
nobody
2016-02-08 14:31:30 -05:00
parent a5f1a9b1da
commit 1a75af526e
3 changed files with 17 additions and 13 deletions

View File

@@ -138,10 +138,8 @@ function Painter:paintIconAndText ()
if w < 1 or h < 1 then return end
-- calculate position for icon and text based on alignment and padding
local iconX, iconY, x1, y1, x2, y2 = self:positionIcon(
x, y, x + w, y + h)
local font, textX, textY = self:positionText(
x1, y1, x2, y2)
local iconX, iconY, x1, y1, x2, y2 = self:positionIcon(x, y, x + w, y + h)
local font, textX, textY = self:positionText(x1, y1, x2, y2)
local icon = widget.icon and self:loadImage(widget.icon)
local text = widget.text
@@ -208,15 +206,13 @@ end
function Painter:paint ()
local widget = self.widget
local x, y, w, h = widget:getRectangle()
-- if the drawable area has no width or height, don't paint
if w < 1 or h < 1 then return end
Event.PreDisplay:emit(widget, { target = widget }, function()
local x, y, w, h = widget:getRectangle()
-- if the drawable area has no width or height, don't paint
if w < 1 or h < 1 then
return
end
Backend.push()
if widget.parent then