Fix crash when Esc key is pressed in drag-and-drop of frames in Timeline

This commit is contained in:
David Capello 2014-06-12 23:12:15 -03:00
parent 6924990992
commit 712d48245b

View File

@ -771,6 +771,16 @@ bool Timeline::onProcessMessage(Message* msg)
case kKeyDownMessage:
switch (static_cast<KeyMessage*>(msg)->scancode()) {
case kKeyEsc:
if (m_state == STATE_STANDBY) {
m_range.disableRange();
invalidate();
}
else {
m_state = STATE_STANDBY;
}
break;
case kKeySpace: {
setCursor(jmouse_x(0), jmouse_y(0));
return true;
@ -781,11 +791,6 @@ bool Timeline::onProcessMessage(Message* msg)
case kKeyUpMessage:
switch (static_cast<KeyMessage*>(msg)->scancode()) {
case kKeyEsc:
m_range.disableRange();
invalidate();
break;
case kKeySpace: {
// We have to clear all the KEY_SPACE in buffer.
clear_keybuf();
@ -1794,6 +1799,9 @@ void Timeline::dropRange(DropOp op)
if (op == Timeline::kMove && drop.layerBegin() == m_range.layerBegin())
return;
break;
default:
ASSERT(false && "You shouldn't call dropRange() if the range is disabled");
return;
}
const char* undoLabel = NULL;