minor bug fixes

This commit is contained in:
airstruck
2015-12-02 01:42:35 -05:00
parent 14b96f4cb5
commit a902385d55
10 changed files with 131 additions and 25 deletions

View File

@@ -194,12 +194,8 @@ function Renderer:renderIconAndText (widget)
return
end
Backend.push()
local parentY = widget.parent and widget.parent:getY() or 0
Backend.setScissor(x, math.max(y, parentY), w, h)
-- calculate position for icon and text based on alignment and padding
local iconX, iconY, x1, y1, x2, y2 = self:positionIcon(
widget, x, y, x + w, y + h)
@@ -242,6 +238,9 @@ function Renderer:renderIconAndText (widget)
end
end
Backend.push()
Backend.setScissor(x, math.max(y, parentY), w, h)
-- draw the icon
if icon then
iconX, iconY = math.floor(iconX), math.floor(iconY)
@@ -252,7 +251,7 @@ function Renderer:renderIconAndText (widget)
end
-- draw the text
if text and w > 1 then
if text and textX and textY and w > 1 then
textX, textY = math.floor(textX), math.floor(textY)
Backend.draw(widget.textData, textX, textY)
end