Thread Tools Display Modes
07-18-19, 08:37 AM   #1
LudiusMaximus
A Rage Talon Dragon Guard
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 320
Error: "SetPoint would result in anchor family connection"

When I do

Code:
_G.FramerateLabel:ClearAllPoints()
_G.FramerateLabel:SetPoint("TOPLEFT", "UIParent", "TOPLEFT")
I get (since 8.2) the following error:

Message: Interface\FrameXML\UIParent.lua:2356: Action[SetPoint] failed because[SetPoint would result in anchor family connection]: attempted from: FramerateLabel:SetPoint

But the effect is exactly what I want: FramerateLabel moves to the top left corner of UIParent.

So what is the meaning of this error?
And is there a way to achieve what I want without causing an error?
  Reply With Quote
07-18-19, 10:39 AM   #2
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
I think this frame is anchored to the WorldFrame by Blizzard but in their "management" code they don't use a ClearAllPoints() so it runs up against the change made in 8.2.

Try Anchoring it to WorldFrame so it's kept "all in the family".
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote
07-22-19, 04:33 PM   #3
LudiusMaximus
A Rage Talon Dragon Guard
 
LudiusMaximus's Avatar
AddOn Author - Click to view addons
Join Date: Mar 2018
Posts: 320
Perfect help! Thanks a lot!
  Reply With Quote
07-22-19, 07:57 PM   #4
Nimhfree
A Frostmaul Preserver
AddOn Author - Click to view addons
Join Date: Aug 2006
Posts: 267
You're lucky...my code however raises an error when I do something like pop through a portal:
Code:
		--	Move the buffs somewhere convenient
		f=BuffFrame
		f:SetMovable(1)
		f:SetUserPlaced(true)
		f:SetScale(.8)
		f:ClearAllPoints()
		f:SetPoint("TOPRIGHT",WorldFrame,"BOTTOMRIGHT",-290,-4)
Code:
66x FrameXML\UIParent.lua:2203: Action[SetPoint] failed because[SetPoint would result in anchor family connection]: attempted from: BuffFrame:SetPoint.
[C]: in function `SetPoint'
FrameXML\UIParent.lua:2203: in function `UIParent_UpdateTopFramePositions'
FrameXML\PlayerFrame.lua:316: in function `PlayerFrame_ResetPosition'
FrameXML\PlayerFrame.lua:200: in function `OnEvent'
FrameXML\UnitFrame.lua:933: in function <FrameXML\UnitFrame.lua:931>
  Reply With Quote
07-22-19, 08:09 PM   #5
Fizzlemizz
I did that?
 
Fizzlemizz's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Dec 2011
Posts: 1,871
Isn't BuffFrame anchored to UIParent?

Edit:
Code:
function UIParent_UpdateTopFramePositions()
	local topOffset = 0;
	local buffsAreaTopOffset = 0;

	if (OrderHallCommandBar and OrderHallCommandBar:IsShown()) then
		topOffset = 12;
		buffsAreaTopOffset = OrderHallCommandBar:GetHeight();
	end

	if (PlayerFrame and not PlayerFrame:IsUserPlaced() and not PlayerFrame_IsAnimatedOut(PlayerFrame)) then
		PlayerFrame:SetPoint("TOPLEFT", UIParent, "TOPLEFT", -19, -4 - topOffset)
	end

	if (TargetFrame and not TargetFrame:IsUserPlaced()) then
		TargetFrame:SetPoint("TOPLEFT", UIParent, "TOPLEFT", 250, -4 - topOffset);
	end

	local ticketStatusFrameShown = TicketStatusFrame and TicketStatusFrame:IsShown();
	local gmChatStatusFrameShown = GMChatStatusFrame and GMChatStatusFrame:IsShown();
	if (ticketStatusFrameShown) then
		TicketStatusFrame:SetPoint("TOPRIGHT", UIParent, "TOPRIGHT", -180, 0 - buffsAreaTopOffset);
		buffsAreaTopOffset = buffsAreaTopOffset + TicketStatusFrame:GetHeight();
	end
	if (gmChatStatusFrameShown) then
		GMChatStatusFrame:SetPoint("TOPRIGHT", UIParent, "TOPRIGHT", -170, -5 - buffsAreaTopOffset);
		buffsAreaTopOffset = buffsAreaTopOffset + GMChatStatusFrame:GetHeight() + 5;
	end
	if (not ticketStatusFrameShown and not gmChatStatusFrameShown) then
		buffsAreaTopOffset = buffsAreaTopOffset + 13;
	end

	BuffFrame:SetPoint("TOPRIGHT", UIParent, "TOPRIGHT", -205, 0 - buffsAreaTopOffset);
end
__________________
Fizzlemizz
Maintainer of Discord Unit Frames and Discord Art.
Author of FauxMazzle, FauxMazzleHUD and Move Pad Plus.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Error: "SetPoint would result in anchor family connection"

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off