mirror of
https://github.com/aseprite/aseprite.git
synced 2024-11-20 14:21:45 +00:00
Hand tool now really scrolls.
This commit is contained in:
parent
9331e3e5d2
commit
b9d0e846b2
@ -109,13 +109,18 @@ class ScrollInk : public ToolInk
|
||||
{
|
||||
public:
|
||||
|
||||
bool isScrollMovement() const { return true; }
|
||||
|
||||
void prepareInk(IToolLoop* loop)
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
void inkHline(int x1, int y, int x2, IToolLoop* loop)
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
@ -81,6 +81,9 @@ public:
|
||||
// Returns true if this ink picks colors from the image
|
||||
virtual bool isEyedropper() const { return false; }
|
||||
|
||||
// Returns true if this ink moves the scroll only
|
||||
virtual bool isScrollMovement() 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) { }
|
||||
|
@ -865,7 +865,8 @@ bool Editor::msg_proc(JMessage msg)
|
||||
context->set_current_sprite(m_sprite);
|
||||
|
||||
/* move the scroll */
|
||||
if (msg->mouse.middle || m_space_pressed) {
|
||||
if (msg->mouse.middle || m_space_pressed ||
|
||||
current_tool->getInk(msg->mouse.right ? 1: 0)->isScrollMovement()) {
|
||||
m_state = EDITOR_STATE_MOVING_SCROLL;
|
||||
|
||||
editor_setcursor(msg->mouse.x, msg->mouse.y);
|
||||
@ -1336,6 +1337,11 @@ void Editor::editor_setcursor(int x, int y)
|
||||
jmouse_set_cursor(JI_CURSOR_EYEDROPPER);
|
||||
return;
|
||||
}
|
||||
else if (current_tool->getInk(0)->isScrollMovement()) {
|
||||
hide_drawing_cursor();
|
||||
jmouse_set_cursor(JI_CURSOR_SCROLL);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (m_insideSelection)
|
||||
|
Loading…
Reference in New Issue
Block a user