diff --git a/src/tools/inks.h b/src/tools/inks.h index 81a4b9df8..dfd440629 100644 --- a/src/tools/inks.h +++ b/src/tools/inks.h @@ -119,12 +119,16 @@ public: class MoveInk : public ToolInk { public: + bool isCelMovement() const { return true; } + void prepareInk(IToolLoop* loop) { + // Do nothing } void inkHline(int x1, int y, int x2, IToolLoop* loop) { + // Do nothing } }; diff --git a/src/tools/tool.h b/src/tools/tool.h index f4329a6cc..f140a76bd 100644 --- a/src/tools/tool.h +++ b/src/tools/tool.h @@ -84,6 +84,9 @@ public: // Returns true if this ink moves the scroll only virtual bool isScrollMovement() const { return false; } + // Returns true if this ink moves cels + virtual bool isCelMovement() const { return false; } + // It is called when the tool-loop start (generally when the user // presses a mouse button over a sprite editor) virtual void prepareInk(IToolLoop* loop) { } diff --git a/src/widgets/editor/editor.cpp b/src/widgets/editor/editor.cpp index a55f4d2a0..3f586a160 100644 --- a/src/widgets/editor/editor.cpp +++ b/src/widgets/editor/editor.cpp @@ -898,11 +898,12 @@ bool Editor::msg_proc(JMessage msg) editor_setcursor(msg->mouse.x, msg->mouse.y); } - /* move frames position */ - else if (m_ctrl_pressed) { + // Move frames position + else if (m_ctrl_pressed || + current_tool->getInk(msg->mouse.right ? 1: 0)->isCelMovement()) { if ((m_sprite->getCurrentLayer()) && (m_sprite->getCurrentLayer()->type == GFXOBJ_LAYER_IMAGE)) { - /* TODO you can move the `Background' with tiled mode */ + // TODO you can move the `Background' with tiled mode if (m_sprite->getCurrentLayer()->is_background()) { jalert(_(PACKAGE "<