Talk:API ScriptRegionResizing SetPoint

From Warcraft Wiki
Jump to navigation Jump to search

It seems to me that the variant

obj:SetPoint(point);

is not working.
The others do work for me.
Maisha

"not working" meaning what, exactly? Posted by: EGingell (T|C|F) on 07:49, 24 February 2009 (UTC)
*not expecting an answer since this was posted almost 3 years ago*

Re: exponential-time increase

This has either been fixed or was unsubstantiated. The following executes in 0.002~ seconds. Creating 50 chained frames takes 1/10000 as long as the author of the example code on the article page claims it takes for 25. I even tried it without making the variables local (it actually took less time using global variables).

local startTime = GetTime()
local NUMFRAMES = 50
local first = CreateFrame("Frame", UIParent);
first:SetPoint("TOPLEFT", UIParent, "BOTTOMLEFT", 700, 500);
first:SetWidth(100);
first:SetHeight(10);
local prev=first;
local f
for i=1,NUMFRAMES do
    f = CreateFrame("Frame", UIParent);
    f:SetPoint("TOPLEFT", prev, "BOTTOMLEFT", 0, -2);
    f:SetPoint("TOPRIGHT", prev, "BOTTOMRIGHT", 0, -2); 
    f:SetHeight(10);
    prev=f;
end
local endTime = GetTime();
print(endTime - startTime) -- prints 0.0019999999931315 for NUMFRAMES = 50 and 0.00099999998928979 for NUMFRAMES = 25

Posted by: EGingell (T|C|F) on 07:49, 24 February 2009 (UTC)

I got a similar result in testing this against Patch 3.1.3, so yes, definitely fixed. I've now removed the exponential time note from the article (along with the screen coordinates -- I just can't figure out what that said). -- foxlit (talk) 01:23, 5 June 2009 (UTC)