Various Magic tools: mend update_rect->h miscalc.

e.g. this "update_rect->h = (y + 16) - update_rect->h;"
should be "update_rect->h = (y + 16) - update_rect->y;"
This commit is contained in:
Bill Kendrick 2022-10-19 01:37:36 -07:00
parent 322780d735
commit 2083b66564
13 changed files with 48 additions and 40 deletions

View file

@ -7,7 +7,7 @@ Various contributors (see below, and AUTHORS.txt)
http://www.tuxpaint.org/
2022.October.18 (0.9.29)
2022.October.19 (0.9.29)
* Improvements to "Stamp" tool:
-----------------------------
* Stamps may now be rotated.
@ -89,6 +89,12 @@ http://www.tuxpaint.org/
the earlier SDL1.2 versions worked.
Bill Kendrick <bill@newbreedsoftware.com>
* Various Magic tools miscalculated which part of canvas
needed updating in their paint mdoes; mended.
(Bricks, Cartoon, Clone, Distortion, Emboss, Glass Tile,
Light, Metal Paint, Negative, and Pixels.)
Bill Kendrick <bill@newbreedsoftware.com>
* Ports & Building:
-----------------
* Processed PNG images through `pngout` to increase some compression

View file

@ -6,7 +6,7 @@
Albert Cahalan <albert@users.sf.net>
Copyright (c) 2002-2021 by Bill Kendrick and others; see AUTHORS.txt
Copyright (c) 2002-2022 by Bill Kendrick and others; see AUTHORS.txt
bill@newbreedsoftware.com
http://www.tuxpaint.org/
@ -25,7 +25,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
Last updated: September 20, 2021
Last updated: October 19, 2022
$Id$
*/
@ -261,10 +261,12 @@ void bricks_drag(magic_api * api, int which, SDL_Surface * canvas,
y = tmp;
}
update_rect->x = x - 64;
update_rect->y = y - 64;
update_rect->w = (ox + 128) - update_rect->x;
update_rect->h = (oy + 128) - update_rect->h;
/* FIXME: Should use nominal_width & _height, specified_length, and vertical_joint here -bjk 2022.10.19 */
update_rect->x = x - 128;
update_rect->y = y - 128;
update_rect->w = (ox + 256) - update_rect->x;
update_rect->h = (oy + 256) - update_rect->y;
api->playsound(brick_snd, (x * 255) / canvas->w, 255);
}

View file

@ -4,7 +4,7 @@
Calligraphy Magic Tool Plugin
Tux Paint - A simple drawing program for children.
Copyright (c) 2002-2021 by Bill Kendrick and others; see AUTHORS.txt
Copyright (c) 2002-2022 by Bill Kendrick and others; see AUTHORS.txt
bill@newbreedsoftware.com
http://www.tuxpaint.org/
@ -23,7 +23,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
Last updated: September 20, 2021
Last updated: October 19, 2022
$Id$
*/
@ -267,7 +267,7 @@ void calligraphy_drag(magic_api * api, int which ATTRIBUTE_UNUSED,
update_rect->x = ox - 16;
update_rect->y = oy - 16;
update_rect->w = (x + 16) - update_rect->x;
update_rect->h = (y + 16) - update_rect->h;
update_rect->h = (y + 16) - update_rect->y;
/* FIXME */

View file

@ -4,7 +4,7 @@
Cartoon Magic Tool Plugin
Tux Paint - A simple drawing program for children.
Copyright (c) 2002-2021 by Bill Kendrick and others; see AUTHORS.txt
Copyright (c) 2002-2022 by Bill Kendrick and others; see AUTHORS.txt
bill@newbreedsoftware.com
http://www.tuxpaint.org/
@ -23,7 +23,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
Last updated: November 8, 2021
Last updated: October 19, 2022
$Id$
*/
@ -244,7 +244,7 @@ void cartoon_drag(magic_api * api, int which, SDL_Surface * canvas,
update_rect->x = ox - 16;
update_rect->y = oy - 16;
update_rect->w = (x + 16) - update_rect->x;
update_rect->h = (y + 16) - update_rect->h;
update_rect->h = (y + 16) - update_rect->y;
api->playsound(cartoon_snd, (x * 255) / canvas->w, 255);
}

View file

@ -4,7 +4,7 @@
Clone tool paintbrush Magic Tools Plugin
Tux Paint - A simple drawing program for children.
Copyright (c) 2021 by Bill Kendrick and others; see AUTHORS.txt
Copyright (c) 2022 by Bill Kendrick and others; see AUTHORS.txt
bill@newbreedsoftware.com
http://www.tuxpaint.org/
@ -23,7 +23,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
Last updated: September 21, 2021
Last updated: October 19, 2022
$Id$
*/
@ -254,7 +254,7 @@ void clone_doit(magic_api * api, int which, SDL_Surface * canvas,
update_rect->x = x - 64;
update_rect->y = y - 64;
update_rect->w = (ox + 128) - update_rect->x;
update_rect->h = (oy + 128) - update_rect->h;
update_rect->h = (oy + 128) - update_rect->y;
}
api->playsound(clone_snd, (x * 255) / canvas->w, 255);

View file

@ -4,7 +4,7 @@
Distortion Magic Tool Plugin
Tux Paint - A simple drawing program for children.
Copyright (c) 2002-2021 by Bill Kendrick and others; see AUTHORS.txt
Copyright (c) 2002-2022 by Bill Kendrick and others; see AUTHORS.txt
bill@newbreedsoftware.com
http://www.tuxpaint.org/
@ -23,7 +23,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
Last updated: September 21, 2021
Last updated: October 19, 2022
$Id$
*/
@ -225,7 +225,7 @@ void distortion_drag(magic_api * api, int which, SDL_Surface * canvas,
update_rect->x = ox - 8;
update_rect->y = oy - 8;
update_rect->w = (x + 8) - update_rect->x;
update_rect->h = (y + 8) - update_rect->h;
update_rect->h = (y + 8) - update_rect->y;
api->playsound(snd_effect, (x * 255) / canvas->w, // pan

View file

@ -4,7 +4,7 @@
Emboss Magic Tool Plugin
Tux Paint - A simple drawing program for children.
Copyright (c) 2002-2021 by Bill Kendrick and others; see AUTHORS.txt
Copyright (c) 2002-2022 by Bill Kendrick and others; see AUTHORS.txt
bill@newbreedsoftware.com
http://www.tuxpaint.org/
@ -23,7 +23,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
Last updated: July 3, 2022
Last updated: October 19, 2022
$Id$
*/
@ -210,7 +210,7 @@ void emboss_drag(magic_api * api, int which, SDL_Surface * canvas,
update_rect->x = ox - 16;
update_rect->y = oy - 16;
update_rect->w = (x + 16) - update_rect->x;
update_rect->h = (y + 16) - update_rect->h;
update_rect->h = (y + 16) - update_rect->y;
api->playsound(emboss_snd, (x * 255) / canvas->w, 255);
}

View file

@ -4,7 +4,7 @@
Glass Tile Magic Tool Plugin
Tux Paint - A simple drawing program for children.
Copyright (c) 2002-2021 by Bill Kendrick and others; see AUTHORS.txt
Copyright (c) 2002-2022 by Bill Kendrick and others; see AUTHORS.txt
bill@newbreedsoftware.com
http://www.tuxpaint.org/
@ -23,7 +23,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
Last updated: November 8, 2021
Last updated: October 19, 2022
$Id$
*/
@ -254,7 +254,7 @@ void glasstile_drag(magic_api * api, int which, SDL_Surface * canvas,
update_rect->x = x - 1;
update_rect->y = y - 1;
update_rect->w = ox - update_rect->x + 1;
update_rect->h = oy - update_rect->h + 1;
update_rect->h = oy - update_rect->y + 1;
*/
api->playsound(glasstile_snd, (x * 255) / canvas->w, 255);

View file

@ -4,7 +4,7 @@
Light Magic Tool Plugin
Tux Paint - A simple drawing program for children.
Copyright (c) 2002-2021 by Bill Kendrick and others; see AUTHORS.txt
Copyright (c) 2002-2022 by Bill Kendrick and others; see AUTHORS.txt
bill@newbreedsoftware.com
http://www.tuxpaint.org/
@ -23,7 +23,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
Last updated: September 21, 2021
Last updated: October 19, 2022
$Id$
*/
@ -217,7 +217,7 @@ void light_drag(magic_api * api, int which, SDL_Surface * canvas,
update_rect->x = ox - 8;
update_rect->y = oy - 8;
update_rect->w = (x + 8) - update_rect->x;
update_rect->h = (y + 8) - update_rect->h;
update_rect->h = (y + 8) - update_rect->y;
api->playsound(light1_snd, (x * 255) / canvas->w, 255);
}

View file

@ -4,7 +4,7 @@
Metal Paint Magic Tool Plugin
Tux Paint - A simple drawing program for children.
Copyright (c) 2002-2021 by Bill Kendrick and others; see AUTHORS.txt
Copyright (c) 2002-2022 by Bill Kendrick and others; see AUTHORS.txt
bill@newbreedsoftware.com
http://www.tuxpaint.org/
@ -23,7 +23,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
Last updated: September 21, 2021
Last updated: October 19, 2022
$Id$
*/
@ -189,7 +189,7 @@ void metalpaint_drag(magic_api * api, int which, SDL_Surface * canvas,
update_rect->x = ox - 8;
update_rect->y = oy - 8;
update_rect->w = (x + 8) - update_rect->x;
update_rect->h = (y + 8) - update_rect->h;
update_rect->h = (y + 8) - update_rect->y;
api->playsound(metalpaint_snd, (x * 255) / canvas->w, 255);
}

View file

@ -4,7 +4,7 @@
Negative Magic Tool Plugin
Tux Paint - A simple drawing program for children.
Copyright (c) 2002-2021 by Bill Kendrick and others; see AUTHORS.txt
Copyright (c) 2002-2022 by Bill Kendrick and others; see AUTHORS.txt
bill@newbreedsoftware.com
http://www.tuxpaint.org/
@ -23,7 +23,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
Last updated: September 21, 2021
Last updated: October 19, 2022
$Id$
*/
@ -235,7 +235,7 @@ void negative_drag(magic_api * api, int which, SDL_Surface * canvas,
update_rect->x = ox - 16;
update_rect->y = oy - 16;
update_rect->w = (x + 16) - update_rect->x;
update_rect->h = (y + 16) - update_rect->h;
update_rect->h = (y + 16) - update_rect->y;
api->playsound(negative_snd, (x * 255) / canvas->w, 255);

View file

@ -4,7 +4,7 @@
Pixel art paintbrush Magic Tools Plugin
Tux Paint - A simple drawing program for children.
Copyright (c) 2021 by Bill Kendrick and others; see AUTHORS.txt
Copyright (c) 2022 by Bill Kendrick and others; see AUTHORS.txt
bill@newbreedsoftware.com
http://www.tuxpaint.org/
@ -23,7 +23,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
Last updated: September 21, 2021
Last updated: October 19, 2022
$Id$
*/
@ -176,7 +176,7 @@ void pixels_drag(magic_api * api, int which, SDL_Surface * canvas,
update_rect->x = x - 64;
update_rect->y = y - 64;
update_rect->w = (ox + 128) - update_rect->x;
update_rect->h = (oy + 128) - update_rect->h;
update_rect->h = (oy + 128) - update_rect->y;
api->playsound(pixel_snd, (x * 255) / canvas->w, 255);
}

View file

@ -6,7 +6,7 @@
Tux Paint - A simple drawing program for children.
Copyright (c) 2013-2021 by Lukasz Dmitrowski
Copyright (c) 2013-2022 by Lukasz Dmitrowski
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@ -23,7 +23,7 @@
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
(See COPYING.txt)
Last updated: September 21, 2021
Last updated: October 19, 2022
*/
#include <stdio.h>
@ -181,7 +181,7 @@ void xor_drag(magic_api * api, int which, SDL_Surface * canvas,
update_rect->x = ox - 16;
update_rect->y = oy - 16;
update_rect->w = (x + 16) - update_rect->x;
update_rect->h = (y + 16) - update_rect->h;
update_rect->h = (y + 16) - update_rect->y;
api->playsound(xor_snd, (x * 255) / canvas->w, 255);
}