From c171500d5ea50813ed4eacf582132fa1b548e704 Mon Sep 17 00:00:00 2001 From: Bill Kendrick Date: Fri, 2 Sep 2022 02:05:52 -0700 Subject: [PATCH] Stamp rotation - Warp mouse to the right, at start ...this ensures that any immediate mouse movement at the beginning of the rotation process will affect the angle only slightly. (As opposed to leaving it in the center of the stamped shape; moving slightly left would rotate the shape ~180 degrees immediately, for example). Also, updated date in CHANGES and src/tuxpaint.c, added new feature to CHANGES, and credited Pere. (Great work!!!) --- docs/CHANGES.txt | 9 ++++++++- src/tuxpaint.c | 11 +++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 2d0bfbf8a..507739065 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -7,7 +7,14 @@ Various contributors (see below, and AUTHORS.txt) http://www.tuxpaint.org/ -2022.July.7 (0.9.29) +2022.September.2 (0.9.29) + * Improvements to "Stamp" tool: + ----------------------------- + * WIP - Stamps may now be rotated. + Use the "--stamp-rotation" option. FIXME: Likely to + become default, with a "--no..." option. + Pere Pujal i Carabantes + * Bug Fixes: ---------- * Opening and immediately dismissing Color Mixer could cause diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 43039989a..dce9e1e3a 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 - July 7, 2022 + June 14, 2002 - September 2, 2022 */ #include "platform.h" @@ -5811,6 +5811,13 @@ static void mainloop(void) { if (stamp_rotation) { + /* 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(old_x + active_stamp->w, old_y); + do_setcursor(cursor_rotate); + stamp_tool_mode = STAMP_TOOL_MODE_ROTATE; stamp_place_x = old_x; stamp_place_y = old_y; @@ -5835,7 +5842,7 @@ static void mainloop(void) } else if (stamp_tool_mode == STAMP_TOOL_MODE_ROTATE) { - /* Draw a stamp! */ + /* Draw a stamp (finishing rotation step)! */ rec_undo_buffer(); playsound(screen, 1, SND_STAMP, 1, stamp_place_x, SNDDIST_NEAR); int stamp_angle_rotation = 360 - brush_rotation(stamp_place_x, stamp_place_y, old_x, old_y);