From 9c3b619fca8a662ee14f9c02321617882685807e Mon Sep 17 00:00:00 2001 From: William Kendrick Date: Sat, 5 Jun 2010 01:39:08 +0000 Subject: [PATCH] Added 1-axis symmetric paint Magic tools (based on the 2-axis Kaleidoscope) --- docs/CHANGES.txt | 7 +++- magic/icons/symmetric_leftright.png | Bin 0 -> 798 bytes magic/icons/symmetric_updown.png | Bin 0 -> 962 bytes magic/src/kalidescope.c | 52 ++++++++++++++++++++++------ 4 files changed, 48 insertions(+), 11 deletions(-) create mode 100644 magic/icons/symmetric_leftright.png create mode 100644 magic/icons/symmetric_updown.png diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index b57ee3ec0..c5d0999ad 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -8,7 +8,7 @@ http://www.tuxpaint.org/ $Id$ -2009.May.28 (0.9.22) +2009.June.4 (0.9.22) * New Tools: ---------- * Label - A tool to add text to a drawing, which can be modified or @@ -32,6 +32,11 @@ $Id$ * ROYGBIV Rainbow - Draw a rainbow arc using solid colors of Red, Orange, Yellow, Green, Blue, Indigo and Violet. + * Symmetry Left/Right, Symmetry Up/Down - Paint with relfective symmetry + across the horizontal or vertical center of the image. + (Like Kaleidoscope, but only one mirrored brush, either left/right + or up/down.) + * Wet Paint - Draws a light coat of paint, and smudges at the same time. (Based on Smudge tool. Requested by gallery artist Angela.) diff --git a/magic/icons/symmetric_leftright.png b/magic/icons/symmetric_leftright.png new file mode 100644 index 0000000000000000000000000000000000000000..ec466cd72943c9ef93c3528c56b95534af470d62 GIT binary patch literal 798 zcmV+(1L6FMP)X00001b5ch_0Itp) z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01pxX01pxYA)E3u00007bV*G`2igV& z0U-_CX>@2HM@dakSAh-}0007cNklgi@4&3CR!%8F{1>rEa89n3!NfN*TDt6fre3Fffs1 zpa^-SC`I06a3xA|OxAZhecXG`3 z&`?3LEXz_#C(w)Y*pgBjo9~lSS{1qZ9uHGWb5tCxY82N;bTZt-q!#_Yoc=LJSDEIj zQ@be!eum|P^^102^u2;{{|qn(*UYQqC2S_)IeuYInMG3;?pVNWtC$v#(T_1jAqcVMV~1z{Wbj7LRmi#VK~TaACaE)8KjGy41*#P&&B zBKVi*hhl)M=o%^t*oyDCjU{EHUpRlFy*DVuY}&WtL}^L`({MVbZGOoY?~a`8Xjcxs!`j^M@d3W4 zuJ20UB!ft+uk@0TM5@Egvhl(LjkfBa7~ cHSV?KH@!yROq)*is{jB107*qoM6N<$f)?p-egFUf literal 0 HcmV?d00001 diff --git a/magic/icons/symmetric_updown.png b/magic/icons/symmetric_updown.png new file mode 100644 index 0000000000000000000000000000000000000000..7b61ebf813bd6a7d230fa0f2d2909ba4cd451162 GIT binary patch literal 962 zcmV;z13mnSP)X00001b5ch_0Itp) z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01pxX01pxYA)E3u00007bV*G`2igV& z0U;i+z0%A8000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}0009WNkl6bZf?u$^S)-K_34WH}_i!UV#2LmJc48IU@iIO_M;V6OOCoq1hGK7a+Ku?br<@Eh*S{6W-kS~CP+i_wSiDgMA4xVk}mFJMDqz6WnLL-08Kgj+K| z6Pxfa-o(r?T#rt4V+x+YcFadl0;Yy#m~fsh|r(Adk|LOo4B!6SQe7&FtxrG zA1JY+G>SF2G(r0!rdR6n+3uX6m3SNHCta3ri$7FU0m18kU1FGgac25t3vVwq*2Tb%JSSlf)LLHLKy-(Q5KpiJWsrkp7)? zC-Vx=`_e=1$6ZmlJBR6r7uqtaX&9#Br0gF|JGTXwjdnRJY0Iy~Rp||f-TFvQdM)0~ z{#rrx#i^gY_%nnDdata_directory); + snprintf(fname, sizeof(fname), "%s/images/magic/%s", + api->data_directory, kal_icon_names[which]); return(IMG_Load(fname)); } @@ -74,13 +86,25 @@ SDL_Surface * kalidescope_get_icon(magic_api * api, int which) // Return our names, localized: char * kalidescope_get_name(magic_api * api, int which) { - return(strdup(gettext_noop("Kaleidoscope"))); + if (which == KAL_LR) { + return(strdup(gettext_noop("Symmetric Left/Right"))); + } else if (which == KAL_UD) { + return(strdup(gettext_noop("Symmetric Up/Down"))); + } else { /* KAL_BOTH */ + return(strdup(gettext_noop("Kaleidoscope"))); + } } // Return our descriptions, localized: char * kalidescope_get_description(magic_api * api, int which, int mode) { - return(strdup(gettext_noop("Click and drag the mouse to draw with symmetric brushes (a kaleidoscope)."))); + if (which == KAL_LR) { + return(strdup(gettext_noop("Click and drag the mouse to draw with two brushes that are symmetric across the left and right of your picture."))); + } else if (which == KAL_UD) { + return(strdup(gettext_noop("Click and drag the mouse to draw with two brushes that are symmetric across the top and bottom of your picture."))); + } else { /* KAL_BOTH */ + return(strdup(gettext_noop("Click and drag the mouse to draw with symmetric brushes (a kaleidoscope)."))); + } } // Do the effect: @@ -104,9 +128,17 @@ static void do_kalidescope(void * ptr, int which, SDL_Surface * canvas, SDL_Surf if (api->in_circle(xx, yy, 8)) { api->putpixel(canvas, x + xx, y + yy, colr); - api->putpixel(canvas, canvas->w - 1 - x + xx, y + yy, colr); - api->putpixel(canvas, x + xx, canvas->h - 1 - y + yy, colr); - api->putpixel(canvas, canvas->w - 1 - x + xx, canvas->h - 1 - y + yy, colr); + + if (which == KAL_LR || which == KAL_BOTH) { + api->putpixel(canvas, canvas->w - 1 - x + xx, y + yy, colr); + + if (which == KAL_BOTH) { + api->putpixel(canvas, canvas->w - 1 - x + xx, canvas->h - 1 - y + yy, colr); + } + } + if (which == KAL_UD || which == KAL_BOTH) { + api->putpixel(canvas, x + xx, canvas->h - 1 - y + yy, colr); + } } } } @@ -124,7 +156,7 @@ void kalidescope_drag(magic_api * api, int which, SDL_Surface * canvas, update_rect->w = canvas->w; update_rect->h = canvas->h; - api->playsound(kalidescope_snd, 255, 255); + api->playsound(kalidescope_snd, 128, 255); } // Affect the canvas on click: