From 2083b66564831bee9849c8fb56f1dd3493cd4f6f Mon Sep 17 00:00:00 2001 From: Bill Kendrick Date: Wed, 19 Oct 2022 01:37:36 -0700 Subject: [PATCH] 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;" --- docs/CHANGES.txt | 8 +++++++- magic/src/bricks.c | 14 ++++++++------ magic/src/calligraphy.c | 6 +++--- magic/src/cartoon.c | 6 +++--- magic/src/clone.c | 6 +++--- magic/src/distortion.c | 6 +++--- magic/src/emboss.c | 6 +++--- magic/src/glasstile.c | 6 +++--- magic/src/light.c | 6 +++--- magic/src/metalpaint.c | 6 +++--- magic/src/negative.c | 6 +++--- magic/src/pixels.c | 6 +++--- magic/src/xor.c | 6 +++--- 13 files changed, 48 insertions(+), 40 deletions(-) diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 4c6598cff..0eee68b19 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.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 + * 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 + * Ports & Building: ----------------- * Processed PNG images through `pngout` to increase some compression diff --git a/magic/src/bricks.c b/magic/src/bricks.c index 7836f61e9..8c4e7af26 100644 --- a/magic/src/bricks.c +++ b/magic/src/bricks.c @@ -6,7 +6,7 @@ Albert Cahalan - 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); } diff --git a/magic/src/calligraphy.c b/magic/src/calligraphy.c index 78af803b0..a85e271c6 100644 --- a/magic/src/calligraphy.c +++ b/magic/src/calligraphy.c @@ -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 */ diff --git a/magic/src/cartoon.c b/magic/src/cartoon.c index 3a0987cb1..10156412e 100644 --- a/magic/src/cartoon.c +++ b/magic/src/cartoon.c @@ -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); } diff --git a/magic/src/clone.c b/magic/src/clone.c index 7dd9ac88d..f54086194 100644 --- a/magic/src/clone.c +++ b/magic/src/clone.c @@ -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); diff --git a/magic/src/distortion.c b/magic/src/distortion.c index 2ec688a55..1db18d71a 100644 --- a/magic/src/distortion.c +++ b/magic/src/distortion.c @@ -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 diff --git a/magic/src/emboss.c b/magic/src/emboss.c index aa687de0a..2634c9f41 100644 --- a/magic/src/emboss.c +++ b/magic/src/emboss.c @@ -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); } diff --git a/magic/src/glasstile.c b/magic/src/glasstile.c index b89eb6df0..5362768f3 100644 --- a/magic/src/glasstile.c +++ b/magic/src/glasstile.c @@ -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); diff --git a/magic/src/light.c b/magic/src/light.c index f1515a8d3..5af40d6df 100644 --- a/magic/src/light.c +++ b/magic/src/light.c @@ -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); } diff --git a/magic/src/metalpaint.c b/magic/src/metalpaint.c index ef79871c2..862774160 100644 --- a/magic/src/metalpaint.c +++ b/magic/src/metalpaint.c @@ -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); } diff --git a/magic/src/negative.c b/magic/src/negative.c index 2fafc93c6..ec3cfce7b 100644 --- a/magic/src/negative.c +++ b/magic/src/negative.c @@ -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); diff --git a/magic/src/pixels.c b/magic/src/pixels.c index 2a4765c98..85ac85660 100644 --- a/magic/src/pixels.c +++ b/magic/src/pixels.c @@ -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); } diff --git a/magic/src/xor.c b/magic/src/xor.c index 3a3b2b6ce..60d365c3e 100644 --- a/magic/src/xor.c +++ b/magic/src/xor.c @@ -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 @@ -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); }