Commit bebbfe34 authored by humfras's avatar humfras
Browse files

No commit message

No commit message
parent 60930edc
......@@ -2149,13 +2149,13 @@
</Button>
<Frame name="VuhDoFrameTemplate" toplevel="true" movable="true" virtual="true">
<Anchors>
<!-- <Anchors>
<Anchor point="CENTER" relativeTo="UIParent">
<Offset>
<AbsDimension x="0" y="0" />
</Offset>
</Anchor>
</Anchors>
</Anchors> -->
<Backdrop bgFile="Interface\AddOns\VuhDoOptions\Images\blue_lt_square_16_16" edgeFile="Interface\AddOns\VuhDoOptions\Images\panel_edges_2" tile="true">
<BackgroundInsets>
<AbsInset left="1" right="1" top="1" bottom="1" />
......
......@@ -17,18 +17,14 @@ VUHDO_IS_CONFIG = false;
--
function VUHDO_tabbedFrameOnMouseDown(aPanel)
-- 8.2 introduced a bug that renders VuhDo Options useless when the main frame is moved
-- disable moving the options frame for now
--aPanel:StartMoving();
aPanel:StartMoving();
end
--
function VUHDO_tabbedFrameOnMouseUp(aPanel)
-- 8.2 introduced a bug that renders VuhDo Options useless when the main frame is moved
-- disable moving the options frame for now
--aPanel:StopMovingOrSizing();
aPanel:StopMovingOrSizing();
end
......@@ -222,51 +218,5 @@ function VUHDO_initOptionsSettings()
["scale"] = 1;
};
end
-- workaround the bug introduced in 8.2 that causes issues moving frame
-- TODO: fix the root cause so we can go back to actually moving the frame
local xs, ys;
local p, rf, rp, x, y;
VuhDoNewOptionsTabbedFrame:SetMovable(true);
VuhDoNewOptionsTabbedFrame:EnableMouse(true);
VuhDoNewOptionsTabbedFrame:RegisterForDrag("LeftButton");
VuhDoNewOptionsTabbedFrame:SetScript("OnDragStart", function(aFrame)
xs, ys = GetCursorPosition();
p, rf, rp, x, y = aFrame:GetPoint();
aFrame:SetScript("OnUpdate", function(self, aTimeDelta)
if not xs then
return;
end
local cx, cy = GetCursorPosition();
local uiScale = UIParent:GetEffectiveScale();
local mx, my = (cx - xs) / uiScale, (cy - ys) / uiScale;
self:ClearAllPoints();
self:SetPoint(p, rf, rp, x + mx, y + my);
end);
aFrame:StartMoving();
end);
VuhDoNewOptionsTabbedFrame:SetScript("OnDragStop", function(aFrame)
local xe, ye = GetCursorPosition();
aFrame:StopMovingOrSizing();
local uiScale = UIParent:GetEffectiveScale();
local mx, my = (xe - xs) / uiScale, (ye - ys) / uiScale;
aFrame:ClearAllPoints();
aFrame:SetPoint(p, rf, rp, x + mx, y + my);
aFrame:SetScript("OnUpdate", VUHDO_optionsOnUpdate)
end);
end
......@@ -248,8 +248,8 @@
<OnLoad>
VUHDO_initOptionsSettings();
</OnLoad>
<!-- <OnMouseDown>VUHDO_tabbedFrameOnMouseDown(self)</OnMouseDown>
<OnMouseUp>VUHDO_tabbedFrameOnMouseUp(self)</OnMouseUp> -->
<OnMouseDown>VUHDO_tabbedFrameOnMouseDown(self)</OnMouseDown>
<OnMouseUp>VUHDO_tabbedFrameOnMouseUp(self)</OnMouseUp>
<OnShow>
self:SetScale(VUHDO_OPTIONS_SETTINGS.scale);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment