mirror of
https://github.com/airstruck/luigi.git
synced 2026-01-10 16:28:23 +00:00
don't render text when no space
This commit is contained in:
@@ -52,9 +52,7 @@ function Font:getAdvance (text)
|
|||||||
return (self.font:getWidth(text))
|
return (self.font:getWidth(text))
|
||||||
end
|
end
|
||||||
|
|
||||||
local major, minor, revision, codename = love.getVersion()
|
if love._version_minor < 10 then
|
||||||
|
|
||||||
if minor < 10 then
|
|
||||||
function Font:getWrappedHeight (text)
|
function Font:getWrappedHeight (text)
|
||||||
local _, lines = self.font:getWrap(text, self.layout.width)
|
local _, lines = self.font:getWrap(text, self.layout.width)
|
||||||
return lines * self.font:getHeight()
|
return lines * self.font:getHeight()
|
||||||
|
|||||||
@@ -103,9 +103,7 @@ end
|
|||||||
|
|
||||||
local getMouseButtonId
|
local getMouseButtonId
|
||||||
|
|
||||||
local major, minor, revision, codename = love.getVersion()
|
if love._version_minor < 10 then
|
||||||
|
|
||||||
if minor < 10 then
|
|
||||||
getMouseButtonId = function (value)
|
getMouseButtonId = function (value)
|
||||||
return value == 'l' and 1
|
return value == 'l' and 1
|
||||||
or value == 'r' and 2
|
or value == 'r' and 2
|
||||||
|
|||||||
@@ -235,7 +235,7 @@ function Renderer:renderIconAndText (widget)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- draw the text
|
-- draw the text
|
||||||
if text then
|
if text and x2 > x1 then
|
||||||
textX, textY = math.floor(textX), math.floor(textY)
|
textX, textY = math.floor(textX), math.floor(textY)
|
||||||
love.graphics.setFont(font.font)
|
love.graphics.setFont(font.font)
|
||||||
love.graphics.setColor(font.color)
|
love.graphics.setColor(font.color)
|
||||||
|
|||||||
Reference in New Issue
Block a user