| |
I have some code that works wonders in 1.10 but crashes WoW on the 1.11 test server. I've simplified the code down to the following minimum test case that can be used to reproduce the error.
The code below produces two small black frames near the middle of your screen: DraggingTest1 (slightly above the center) and DraggingTest2 (dead center).
Try to drag DraggingTest2 and the game will crash.
<Button name="DraggingTest1" movable="true" parent="UIParent">
<Backdrop name="$parentBackdrop" bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<TileSize>
<AbsValue val="16"/>
</TileSize>
</Backdrop>
<Size>
<AbsDimension x="5" y="5"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="50"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
this:SetBackdropColor(0, 0, 0, 1);
this:SetBackdropBorderColor(nil, nil, nil, 0);
</OnLoad>
</Scripts>
</Button>
<Button name="DraggingTest2" movable="true" parent="UIParent">
<Backdrop name="$parentBackdrop" bgFile="Interface\Tooltips\UI-Tooltip-Background" edgeFile="Interface\Tooltips\UI-Tooltip-Border" tile="true">
<TileSize>
<AbsValue val="16"/>
</TileSize>
</Backdrop>
<Size>
<AbsDimension x="5" y="5"/>
</Size>
<Anchors>
<Anchor point="CENTER">
<Offset>
<AbsDimension x="0" y="0"/>
</Offset>
</Anchor>
</Anchors>
<Scripts>
<OnLoad>
this:SetBackdropColor(0, 0, 0, 1);
this:SetBackdropBorderColor(nil, nil, nil, 0);
this:RegisterForDrag("LeftButton");
</OnLoad>
<OnUpdate>
if(this.moving) then
-- the following two lines seem to be the magic that crashes it
this:ClearAllPoints();
this:SetPoint("TOP", "DraggingTest1", "TOPRIGHT", 50, 0);
end
</OnUpdate>
<OnDragStart>
this:StartMoving();
this.moving = true;
</OnDragStart>
<OnDragStop>
this:StopMovingOrSizing();
this.moving = nil;
</OnDragStop>
</Scripts>
</Button>
|