diff --git a/ElvUI/Modules/NamePlates/Elements/HealthBar.lua b/ElvUI/Modules/NamePlates/Elements/HealthBar.lua index cbef134..c48e05d 100644 --- a/ElvUI/Modules/NamePlates/Elements/HealthBar.lua +++ b/ElvUI/Modules/NamePlates/Elements/HealthBar.lua @@ -119,16 +119,6 @@ function mod:ConfigureElement_HealthBar(frame, configuring) healthBar:SetPoint("TOP", frame, "CENTER", 0, self.db.units[frame.UnitType].castbar.height + 3) - local width, height = self.db.clickableWidth + ((E.PixelMode and 2) or 6), self.db.clickableHeight + self.db.units[frame.UnitType].castbar.height + 3 - if self.db.motionType ~= "OVERLAP" then - frame:GetParent():SetWidth(width) - frame:GetParent():SetHeight(height) - else - frame:GetParent():SetHitRectInsets(-.5*width, -.5*width, -.5*height, -.5*height) - end - frame:SetWidth(width) - frame:SetHeight(height) - if frame.isTarget and self.db.useTargetScale then healthBar:SetHeight(self.db.units[frame.UnitType].healthbar.height * ((frame.CustomScale and frame.CustomScale * self.db.targetScale) or self.db.targetScale)) healthBar:SetWidth(self.db.units[frame.UnitType].healthbar.width * ((frame.CustomScale and frame.CustomScale * self.db.targetScale) or self.db.targetScale)) diff --git a/ElvUI/Modules/NamePlates/NamePlates.lua b/ElvUI/Modules/NamePlates/NamePlates.lua index 459df4e..622f18c 100644 --- a/ElvUI/Modules/NamePlates/NamePlates.lua +++ b/ElvUI/Modules/NamePlates/NamePlates.lua @@ -318,10 +318,6 @@ end function mod:OnShow(self, isUpdate) self = self or this - if mod.db.motionType == "OVERLAP" then - self:SetWidth(0.01) - self:SetHeight(0.01) - end if not isUpdate then self.UnitFrame.moveUp:Play() @@ -335,6 +331,21 @@ function mod:OnShow(self, isUpdate) self.UnitFrame.UnitClass = mod:UnitClass(self.UnitFrame.oldName:GetText(), unitType) self.UnitFrame.UnitReaction = unitReaction + local width, height = mod.db.clickableWidth + ((E.PixelMode and 2) or 6), mod.db.clickableHeight + mod.db.units[unitType].castbar.height + 3 + self.UnitFrame:SetWidth(width) + self.UnitFrame:SetHeight(height) + + if mod.db.motionType == "OVERLAP" then + width, height = .5*width, .5*height + self:SetWidth(0.01) + self:SetHeight(0.01) + self:SetHitRectInsets(-width, -width, -height, -height) + else + self:SetWidth(width) + self:SetHeight(height) + self:SetHitRectInsets(0, 0, 0, 0) + end + if unitType == "FRIENDLY_PLAYER" or unitType == "FRIENDLY_NPC" then self:EnableMouse(not mod.db.clickThrough.friendly) self.UnitFrame:EnableMouse(not mod.db.clickThrough.friendly)