From d00a5cfcd40a3c02f8ec040526e7f5898caaf24d Mon Sep 17 00:00:00 2001 From: Yves Rizoud Date: Tue, 18 May 2010 01:11:58 +0000 Subject: [PATCH] Fix bug with >16 paintbrushes git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1482 416bcca6-2ee7-4201-b75f-2eb2f807beb1 --- src/buttons.c | 55 ++++++++++++++++++++++++++++++++------------------- src/const.h | 10 +++++++++- src/windows.c | 13 ++++++++---- 3 files changed, 53 insertions(+), 25 deletions(-) diff --git a/src/buttons.c b/src/buttons.c index 68ea2cd8..c87e6d59 100644 --- a/src/buttons.c +++ b/src/buttons.c @@ -5028,14 +5028,26 @@ void Store_brush(int index) void Select_paintbrush(int index) { int x_pos,y_pos; + Paintbrush_shape=Paintbrush[index].Shape; - Paintbrush_width=Paintbrush[index].Width; - Paintbrush_height=Paintbrush[index].Height; - Paintbrush_offset_X=Paintbrush[index].Offset_X; - Paintbrush_offset_Y=Paintbrush[index].Offset_Y; - for (y_pos=0; y_posPAINTBRUSH_WIDTH) + x_off=(Paintbrush_width-PAINTBRUSH_WIDTH)/2; + if (Paintbrush_height>PAINTBRUSH_HEIGHT) + y_off=(Paintbrush_height-PAINTBRUSH_HEIGHT)/2; + + for (y_pos=0; y_pos