Fix bug where the user weren't able to move a range cel X/Y positions (fix #669)

This commit is contained in:
David Capello 2015-06-02 16:47:06 -03:00
parent 61c745ee7c
commit 01eacb2952

View File

@ -36,6 +36,7 @@
#include "app/ui/skin/skin_theme.h" #include "app/ui/skin/skin_theme.h"
#include "app/ui/skin/style.h" #include "app/ui/skin/style.h"
#include "app/ui/status_bar.h" #include "app/ui/status_bar.h"
#include "app/ui/workspace.h"
#include "app/ui_context.h" #include "app/ui_context.h"
#include "app/util/clipboard.h" #include "app/util/clipboard.h"
#include "base/convert_to.h" #include "base/convert_to.h"
@ -2332,14 +2333,19 @@ FrameTag* Timeline::Hit::getFrameTag() const
void Timeline::onNewInputPriority(InputChainElement* element) void Timeline::onNewInputPriority(InputChainElement* element)
{ {
// As a another input element has priority (e.g. Timeline or // It looks like the user wants to execute commands targetting the
// Editor), it looks like the user wants to execute commands // ColorBar instead of the Timeline. Here we disable the selected
// targetting the editor instead of the timeline. Here we disable // range, so commands like Clear, Copy, Cut, etc. don't target the
// the selected range, so commands like Clear, Copy, Cut, etc. don't // Timeline and they are sent to the active sprite editor.
// target the Timeline and they are sent to the active sprite //
// editor. // If the Workspace is selected (an sprite Editor), maybe the user
m_range.disableRange(); // want to move the X/Y position of all cels in the Timeline range.
invalidate(); // That is why we don't disable the range in this case.
Workspace* workspace = dynamic_cast<Workspace*>(element);
if (!workspace) {
m_range.disableRange();
invalidate();
}
} }
bool Timeline::onCanCut(Context* ctx) bool Timeline::onCanCut(Context* ctx)