diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index d777ea0e6..d4de356ac 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -7,7 +7,7 @@ Various contributors (see below, and AUTHORS.txt) http://www.tuxpaint.org/ -2022.September.10 (0.9.29) +2022.September.11 (0.9.29) * Improvements to "Stamp" tool: ----------------------------- * Stamps may now be rotated. diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 8a0dbeff8..59146ecae 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -22,7 +22,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA (See COPYING.txt) - June 14, 2002 - September 5, 2022 + June 14, 2002 - September 11, 2022 */ #include "platform.h" @@ -5827,11 +5827,18 @@ static void mainloop(void) { if (!no_stamp_rotation) { + int mouse_warp_x; + /* Going through stamp rotation step, first */ /* Warp mouse to the far right of the stamp, - where we'll start at 0-degrees of rotation */ - SDL_WarpMouse(r_tools.w + old_x + active_stamp->w, old_y); + where we'll start at 0-degrees of rotation + (keep it within the canvas, though!) */ + mouse_warp_x = r_tools.w + old_x + (CUR_STAMP_W / 2); + if (mouse_warp_x >= WINDOW_WIDTH - r_ttoolopt.w) + mouse_warp_x = WINDOW_WIDTH - r_ttoolopt.w - 1; + + SDL_WarpMouse(mouse_warp_x, old_y); do_setcursor(cursor_rotate); stamp_tool_mode = STAMP_TOOL_MODE_ROTATE;