| 69 | } |
| 70 | |
| 71 | void ToolLoopManager::pressButton(const Pointer& pointer) |
| 72 | { |
| 73 | m_lastPointer = pointer; |
| 74 | |
| 75 | if (isCanceled()) |
| 76 | return; |
| 77 | |
| 78 | // If the user pressed the other mouse button... |
| 79 | if ((m_toolLoop->getMouseButton() == ToolLoop::Left && pointer.button() == Pointer::Right) || |
| 80 | (m_toolLoop->getMouseButton() == ToolLoop::Right && pointer.button() == Pointer::Left)) { |
| 81 | // Cancel the tool-loop (the destination image should be completelly discarded) |
| 82 | m_toolLoop->cancel(); |
| 83 | return; |
| 84 | } |
| 85 | |
| 86 | // Convert the screen point to a sprite point |
| 87 | Point spritePoint = pointer.point(); |
| 88 | m_toolLoop->setSpeed(Point(0, 0)); |
| 89 | m_oldPoint = spritePoint; |
| 90 | snapToGrid(spritePoint); |
| 91 | |
| 92 | m_toolLoop->getController()->pressButton(m_stroke, spritePoint, pointer.pressure()); |
| 93 | |
| 94 | std::string statusText; |
| 95 | m_toolLoop->getController()->getStatusBarText(m_stroke, statusText); |
| 96 | m_toolLoop->updateStatusBar(statusText.c_str()); |
| 97 | |
| 98 | doLoopStep(false); |
| 99 | } |
| 100 | |
| 101 | bool ToolLoopManager::releaseButton(const Pointer& pointer) |
| 102 | { |
nothing calls this directly
no test coverage detected