mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
fixed issue #150
holding CTRL while moving a point allows to be a lot more precise
This commit is contained in:
parent
b6d07edda8
commit
97204482e2
|
@ -2588,12 +2588,20 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
|
|||
}
|
||||
else
|
||||
{
|
||||
pEnvelope->m_lPoints[i].m_aValues[c] -= f2fx(m_MouseDeltaY*ValueScale);
|
||||
if((Input()->KeyPressed(KEY_LCTRL) || Input()->KeyPressed(KEY_RCTRL)))
|
||||
pEnvelope->m_lPoints[i].m_aValues[c] -= f2fx(m_MouseDeltaY*0.001f);
|
||||
else
|
||||
pEnvelope->m_lPoints[i].m_aValues[c] -= f2fx(m_MouseDeltaY*ValueScale);
|
||||
|
||||
if(Input()->KeyPressed(KEY_LSHIFT) || Input()->KeyPressed(KEY_RSHIFT))
|
||||
{
|
||||
if((Input()->KeyPressed(KEY_LCTRL) || Input()->KeyPressed(KEY_RCTRL)))
|
||||
pEnvelope->m_lPoints[i].m_Time += (int)((m_MouseDeltaX));
|
||||
else
|
||||
pEnvelope->m_lPoints[i].m_Time += (int)((m_MouseDeltaX*TimeScale)*1000.0f);
|
||||
|
||||
if(i != 0)
|
||||
{
|
||||
pEnvelope->m_lPoints[i].m_Time += (int)((m_MouseDeltaX*TimeScale)*1000.0f);
|
||||
if(pEnvelope->m_lPoints[i].m_Time < pEnvelope->m_lPoints[i-1].m_Time)
|
||||
pEnvelope->m_lPoints[i].m_Time = pEnvelope->m_lPoints[i-1].m_Time + 1;
|
||||
if(i+1 != pEnvelope->m_lPoints.size() && pEnvelope->m_lPoints[i].m_Time > pEnvelope->m_lPoints[i+1].m_Time)
|
||||
|
@ -2620,7 +2628,7 @@ void CEditor::RenderEnvelopeEditor(CUIRect View)
|
|||
|
||||
ColorMod = 100.0f;
|
||||
Graphics()->SetColor(1,0.75f,0.75f,1);
|
||||
m_pTooltip = Localize("Left mouse to drag. Hold shift to alter time point aswell. Right click to delete.");
|
||||
m_pTooltip = Localize("Left mouse to drag. Hold ctfl to be more precise. Hold shift to alter time point aswell. Right click to delete.");
|
||||
}
|
||||
|
||||
if(UI()->ActiveItem() == pId || UI()->HotItem() == pId)
|
||||
|
|
Loading…
Reference in a new issue