Skip to content

Commit

Permalink
Tooltip fix
Browse files Browse the repository at this point in the history
  • Loading branch information
linux-man committed May 9, 2020
1 parent e831e54 commit 3a9d87f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions loveframes/objects/internal/tooltip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
return function(loveframes)
---------- module start ----------

-- tooltip clas
-- tooltip class
local newobject = loveframes.NewObject("tooltip", "loveframes_object_tooltip", true)

--[[---------------------------------------------------------
Expand Down Expand Up @@ -34,7 +34,7 @@ function newobject:initialize(object, text)
textobject:Remove()
textobject.parent = self
textobject:SetText(text or "")
textobject:SetPos(0, 0)
textobject:SetPos(10000, 0) -- textobject interferes with hover detection
table.insert(self.internals, textobject)

-- apply template properties to the object
Expand All @@ -59,15 +59,16 @@ function newobject:update(dt)

local visible = self.visible
local alwaysupdate = self.alwaysupdate
local internals = self.internals
local textobject = internals[1]

if not visible then
textobject:SetPos(10000, 0) -- textobject interferes with hover detection
if not alwaysupdate then
return
end
end

local internals = self.internals
local textobject = internals[1]
local padding = self.padding
local object = self.object
local draworder = self.draworder
Expand Down

0 comments on commit 3a9d87f

Please sign in to comment.