mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
fixed quad selection via envelope preview
This commit is contained in:
parent
f36cc57bdd
commit
2708256186
|
@ -1501,6 +1501,7 @@ void CEditor::DoQuadEnvPoint(CQuad *pQuad, int QIndex, int PIndex)
|
|||
float wy = UI()->MouseWorldY();
|
||||
CEnvelope *pEnvelope = m_Map.m_lEnvelopes[pQuad->m_PosEnv];
|
||||
void *pID = &pEnvelope->m_lPoints[PIndex];
|
||||
static int s_ActQIndex = -1;
|
||||
|
||||
// get pivot
|
||||
float CenterX = fx2f(pQuad->m_aPoints[4].x)+fx2f(pEnvelope->m_lPoints[PIndex].m_aValues[0]);
|
||||
|
@ -1508,10 +1509,13 @@ void CEditor::DoQuadEnvPoint(CQuad *pQuad, int QIndex, int PIndex)
|
|||
|
||||
float dx = (CenterX - wx)/m_WorldZoom;
|
||||
float dy = (CenterY - wy)/m_WorldZoom;
|
||||
if(dx*dx+dy*dy < 50)
|
||||
if(dx*dx+dy*dy < 50.0f && UI()->ActiveItem() == 0)
|
||||
{
|
||||
UI()->SetHotItem(pID);
|
||||
s_ActQIndex = QIndex;
|
||||
}
|
||||
|
||||
if(UI()->ActiveItem() == pID)
|
||||
if(UI()->ActiveItem() == pID && s_ActQIndex == QIndex)
|
||||
{
|
||||
if(s_Operation == OP_MOVE)
|
||||
{
|
||||
|
@ -1554,7 +1558,7 @@ void CEditor::DoQuadEnvPoint(CQuad *pQuad, int QIndex, int PIndex)
|
|||
|
||||
Graphics()->SetColor(1.0f, 1.0f, 1.0f, 1.0f);
|
||||
}
|
||||
else if(UI()->HotItem() == pID)
|
||||
else if(UI()->HotItem() == pID && s_ActQIndex == QIndex)
|
||||
{
|
||||
ms_pUiGotContext = pID;
|
||||
|
||||
|
|
Loading…
Reference in a new issue