Fixing stale XOR left when rotating then click on another stamp image before finish rotation. Also counting button size when warping mouse.

This commit is contained in:
Pere Pujal i Carabantes 2022-09-11 14:41:40 +02:00
parent 1a1a4bb50b
commit cc28f48f7e

View file

@ -4859,6 +4859,11 @@ static void mainloop(void)
if (cur_thing != cur_stamp[stamp_group])
{
if (stamp_tool_mode == STAMP_TOOL_MODE_ROTATE)
{
stamp_xor(stamp_place_x, stamp_place_y);
reset_stamps(&stamp_xored_rt, &stamp_place_x, &stamp_place_y, &stamp_tool_mode);
}
cur_stamp[stamp_group] = cur_thing;
set_active_stamp();
update_stamp_xor(0);
@ -5826,7 +5831,7 @@ static void mainloop(void)
/* 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);
SDL_WarpMouse(r_tools.w + old_x + active_stamp->w, old_y);
do_setcursor(cursor_rotate);
stamp_tool_mode = STAMP_TOOL_MODE_ROTATE;