Quantcast

Fixed issues with portrait

p3lim-52096 [02-15-09 - 11:07]
Fixed issues with portrait

git-svn-id: svn://svn.wowinterface.com/oUF_P3lim-52/trunk@60 8c7459ed-49dc-4bc8-85d7-b6381a8f5413
Filename
oUF_P3lim/oUF_P3lim.lua
diff --git a/oUF_P3lim/oUF_P3lim.lua b/oUF_P3lim/oUF_P3lim.lua
index fa8dcf1..17ec9a3 100644
--- a/oUF_P3lim/oUF_P3lim.lua
+++ b/oUF_P3lim/oUF_P3lim.lua
@@ -132,12 +132,12 @@ local function UpdateDruidPower(self)
 	end
 end

-local function UpdatePortrait(self, min, max)
+local function UpdatePortrait(self)
 	if(UnitIsDeadOrGhost(self.unit)) then
 		self.Portrait:Hide()
 	else
 		self.Portrait:Show()
-		self.Portrait:SetWidth(230 * min/max)
+		self.Portrait:SetWidth(230 * UnitHealth(self.unit) / UnitHealthMax(self.unit))
 	end
 end

@@ -173,7 +173,7 @@ local function PostUpdateHealth(self, event, unit, bar, min, max)
 	end

 	if(self.Portrait) then
-		UpdatePortrait(self, min, max)
+		UpdatePortrait(self)
 	end
 end