From 5cfe84153c48f4fb77a01e7be7c3acb6fc623a7e Mon Sep 17 00:00:00 2001 From: William Kendrick Date: Tue, 5 Sep 2006 18:09:37 +0000 Subject: [PATCH] Improved spacing on squirrel brush. Added spacing value to kuro neko brush. Fixed bug with directional/animated brush display in toolbox. Corrected counter bug when cycling animated brush frames. --- data/brushes/kuroneko.dat | 1 + data/brushes/squirrel.dat | 2 +- src/tuxpaint.c | 7 ++++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/data/brushes/kuroneko.dat b/data/brushes/kuroneko.dat index 75b0fd5b2..86a0d8940 100644 --- a/data/brushes/kuroneko.dat +++ b/data/brushes/kuroneko.dat @@ -1,2 +1,3 @@ frames=2 directional +spacing=40 diff --git a/data/brushes/squirrel.dat b/data/brushes/squirrel.dat index 02c03c2da..25e539e8e 100644 --- a/data/brushes/squirrel.dat +++ b/data/brushes/squirrel.dat @@ -1,3 +1,3 @@ frames=3 directional -spacing=40 +spacing=48 diff --git a/src/tuxpaint.c b/src/tuxpaint.c index 0df6ed6a3..1d03e7831 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 - September 4, 2006 + June 14, 2002 - September 5, 2006 $Id$ */ @@ -3541,7 +3541,7 @@ static void blit_brush(int x, int y, int direction) brush_counter = 0; brush_frame++; - if (brush_frame > img_cur_brush_frames) + if (brush_frame >= img_cur_brush_frames) brush_frame = 0; dest.x = x; @@ -7578,7 +7578,8 @@ static void draw_brushes(void) src.x = 0; src.y = brushes_directional[brush] ? (img_brushes[brush]->h / 3) : 0; - src.w = img_brushes[brush]->w / brushes_frames[brush]; + src.w = (img_brushes[brush]->w / brushes_frames[brush]) / + (brushes_directional[brush] ? 3 : 1); src.h = (img_brushes[brush]->h / (brushes_directional[brush] ? 3 : 1)); dest.x = ((i % 2) * 48) + (WINDOW_WIDTH - 96) + ((48 - src.w) >> 1);