From c007c63baf4c6aa334fe55c09528b2590d7c7e62 Mon Sep 17 00:00:00 2001 From: William Kendrick Date: Tue, 4 Mar 2008 17:03:12 +0000 Subject: [PATCH] Brushes with large spacing wouldn't be spaced properly when drawn from bottom-to-top using the line tool. Fixed. (Pere Pujal i Carabantes patch from SourceForge bug.) --- docs/CHANGES.txt | 3 +++ src/tuxpaint.c | 13 +++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/CHANGES.txt b/docs/CHANGES.txt index ad6eb854e..3489f94bf 100644 --- a/docs/CHANGES.txt +++ b/docs/CHANGES.txt @@ -42,6 +42,9 @@ $Id$ Forcing it to always use white, which was the only background color in early versions of Tux Paint. + * Brushes with large spacing wouldn't be spaced properly when drawn + from bottom-to-top using the line tool. Fixed. + Pere Pujal i Carabantes 2008.February.25 (0.9.19) * New Localizations: diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 81eba072c..1387230e4 100644 --- a/src/tuxpaint.c +++ b/src/tuxpaint.c @@ -4090,13 +4090,14 @@ static void brush_draw(int x1, int y1, int x2, int y2, int update) if (y1 > y2) { - y = y1; - y1 = y2; - y2 = y; + for (y = y1; y >= y2; y--) + blit_brush(x1, y, direction); + } + else + { + for (y = y1; y <= y2; y++) + blit_brush(x1, y, direction); } - - for (y = y1; y <= y2; y++) - blit_brush(x1, y, direction); x1 = x1 + dx; }