mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 06:32:42 +00:00
Added ToolInk::isCelMovement(). Now "Move" tool moves cel.
This commit is contained in:
parent
bb6815524f
commit
20c4ac5235
@ -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
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -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) { }
|
||||
|
@ -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
|
||||
"<<You can't move the `Background' layer."
|
||||
|
Loading…
x
Reference in New Issue
Block a user