diff Libs/DF/cooltip.lua @ 56:7c0f819a85c6 v7.3.5.056

- Framework update.
author Tercio
date Sun, 11 Mar 2018 10:50:12 -0300
parents 307f5af3ad02
children 0682d738499b
line wrap: on
line diff
--- a/Libs/DF/cooltip.lua	Sat Dec 09 11:49:01 2017 -0200
+++ b/Libs/DF/cooltip.lua	Sun Mar 11 10:50:12 2018 -0300
@@ -1623,7 +1623,7 @@
 			end
 
 		end
-
+		
 		if (CoolTip.OptionsTable.FixedHeight) then
 			frame1:SetHeight (CoolTip.OptionsTable.FixedHeight)
 		else
@@ -1683,6 +1683,7 @@
 		frame1:ClearAllPoints()
 		
 		local anchor = CoolTip.OptionsTable.Anchor or CoolTip.Host
+		
 		frame1:SetPoint (CoolTip.OptionsTable.MyAnchor, anchor, CoolTip.OptionsTable.RelativeAnchor, 0 + moveX + CoolTip.OptionsTable.WidthAnchorMod, 10 + CoolTip.OptionsTable.HeightAnchorMod + moveY)
 		
 		if (not x_mod) then
@@ -1850,12 +1851,12 @@
 		function CoolTip:SetHost (frame, myPoint, hisPoint, x, y)
 			--> check data integrity
 			if (type (frame) ~= "table" or not frame.GetObjectType) then
-				print ("host need to be a frame")
+				print ("host needs to be a frame")
 				return --> error
 			end
 			
 			CoolTip.Host = frame
-
+			
 			CoolTip.frame1:SetFrameLevel (frame:GetFrameLevel()+1)
 			
 			--> defaults
@@ -2964,6 +2965,11 @@
 		CoolTip:SetColor ("main", host.CoolTip.MainColor or "transparent")
 		CoolTip:SetColor ("sec", host.CoolTip.SubColor or "transparent")
 		
+		local okay, errortext = pcall (host.CoolTip.BuildFunc, host, host.CoolTip and host.CoolTip.FixedValue) --resetting anchors
+		if (not okay) then
+			print ("Cooltip Injected Fucntion Error:", errortext)
+		end		
+
 		CoolTip:SetOwner (host, host.CoolTip.MyAnchor, host.CoolTip.HisAnchor, host.CoolTip.X, host.CoolTip.Y)
 		
 		local options = host.CoolTip.Options
@@ -2976,15 +2982,13 @@
 			end
 		end
 		
-		host.CoolTip.BuildFunc()
-		
 		if (CoolTip.Indexes == 0) then
 			if (host.CoolTip.Default) then
 				CoolTip:SetType ("tooltip")
 				CoolTip:AddLine (host.CoolTip.Default, nil, 1, "white")
 			end
 		end
-		
+
 		CoolTip:ShowCooltip()
 		
 		if (fromClick) then