From 2936285797c171f16e488e289a29e7a98fa8829e Mon Sep 17 00:00:00 2001 From: William Kendrick Date: Fri, 23 Sep 2011 18:41:09 +0000 Subject: [PATCH] Right-side image on dialogs would be scaled/cut-off even if it was the only one. Could not print the first time until 'print delay' passed. --- docs/CHANGES.txt | 8 +++++++- src/tuxpaint.c | 10 ++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index 9661af3d1..ed266d0f2 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -8,7 +8,7 @@ http://www.tuxpaint.org/ $Id$ -2011.July.2 (0.9.22) +2011.September.23 (0.9.22) * New Tools: ---------- @@ -480,6 +480,12 @@ $Id$ * Bug Fixes --------- + * Image on right of dialogs would get scaled/cut-off even if there was + room for them. + + * When using 'print delay' option, it would not allow printing the + first time until the delay had passed. + * Fixed error reporting when make_directory() fails. (Fixes spurious SF.net Bug #2765872) diff --git a/src/tuxpaint.c b/src/tuxpaint.c index d4e9e6bcd..3852e76da 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 26, 2011 + June 14, 2002 - September 23, 2011 */ @@ -1111,6 +1111,7 @@ static int starter_modified; static Uint8 canvas_color_r, canvas_color_g, canvas_color_b; static Uint8 * touched; +static int last_print_time = 0; static int shape_radius; @@ -11892,7 +11893,7 @@ static int do_prompt_image_flash_snd(const char *const text, if (img1 != NULL) { - if (img1->h > 64) + if (img1->h > 64 && img2 != NULL /* Only scale if it matters */) { img1b = thumbnail(img1, 80, 64, 1); free_img1b = 1; @@ -16121,7 +16122,6 @@ static void hsvtorgb(float h, float s, float v, Uint8 * r8, Uint8 * g8, static void print_image(void) { - static int last_print_time = 0; int cur_time; cur_time = SDL_GetTicks() / 1000; @@ -21578,8 +21578,10 @@ static void setup_config(char *argv[]) rotate_orientation = !strcmp(tmpcfg.rotate_orientation, "portrait"); // alternative is "landscape" if(tmpcfg.colorfile) strcpy(colorfile, tmpcfg.colorfile); // FIXME can overflow - if(tmpcfg.print_delay) + if(tmpcfg.print_delay) { print_delay = atoi(tmpcfg.print_delay); + last_print_time = -print_delay; + } #ifdef PAPER_H if(tmpcfg.printcommand) printcommand = tmpcfg.printcommand;