mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-22 15:46:56 +00:00
core: switch from mousedown to drag functions
Due to crashes/freezes while moving some frames, one possible reason could be that pfUI was using OnMouseDown and OnMouseUp to run its frame-moving code. I have noticed better performance when using the intended functions, OnDragStart and OnDragStop to move frames. This commit changes every occurrence of such functions and splits drag and click into seperate functions where required.
This commit is contained in:
+6
-5
@@ -39,6 +39,10 @@ pfUI:RegisterModule("map", "vanilla:tbc", function ()
|
||||
|
||||
UIPanelWindows["WorldMapFrame"] = { area = "center" }
|
||||
|
||||
WorldMapFrame:SetMovable(true)
|
||||
WorldMapFrame:EnableMouse(true)
|
||||
WorldMapFrame:RegisterForDrag("LeftButton")
|
||||
|
||||
WorldMapFrame:SetScript("OnShow", function()
|
||||
-- default events
|
||||
UpdateMicroButtons()
|
||||
@@ -67,18 +71,15 @@ pfUI:RegisterModule("map", "vanilla:tbc", function ()
|
||||
SaveMovable(this, true)
|
||||
end)
|
||||
|
||||
WorldMapFrame:SetScript("OnMouseDown",function()
|
||||
WorldMapFrame:SetScript("OnDragStart",function()
|
||||
WorldMapFrame:StartMoving()
|
||||
end)
|
||||
|
||||
WorldMapFrame:SetScript("OnMouseUp",function()
|
||||
WorldMapFrame:SetScript("OnDragStop",function()
|
||||
WorldMapFrame:StopMovingOrSizing()
|
||||
SaveMovable(this, true)
|
||||
end)
|
||||
|
||||
WorldMapFrame:SetMovable(true)
|
||||
WorldMapFrame:EnableMouse(true)
|
||||
|
||||
WorldMapFrame:SetAlpha(alpha)
|
||||
WorldMapFrame:SetScale(scale)
|
||||
UpdateTooltipScale()
|
||||
|
||||
Reference in New Issue
Block a user