grid coords not set up right; fixed now

This commit is contained in:
Albert Cahalan 2005-01-01 06:47:01 +00:00
parent 874e08671e
commit 2515f630af

View file

@ -2871,7 +2871,6 @@ static void mainloop(void)
{ {
num_things = num_brushes; num_things = num_brushes;
thing_scroll = brush_scroll; thing_scroll = brush_scroll;
gd_controls.rows = (num_things+1)/2;
} }
else if (cur_tool == TOOL_STAMP) else if (cur_tool == TOOL_STAMP)
{ {
@ -2906,7 +2905,6 @@ static void mainloop(void)
// number of whole or partial rows that will be needed // number of whole or partial rows that will be needed
// (can make this per-tool if variable columns needed) // (can make this per-tool if variable columns needed)
int num_rows_needed = (num_things+gd_items.cols-1)/gd_items.cols; int num_rows_needed = (num_things+gd_items.cols-1)/gd_items.cols;
gd_items.rows = num_rows_needed;
do_draw = 0; do_draw = 0;
@ -2923,13 +2921,13 @@ static void mainloop(void)
r_notcontrols.y = r_toolopt.y; r_notcontrols.y = r_toolopt.y;
SDL_Rect r_items = r_notcontrols; SDL_Rect r_items = r_notcontrols;
if(gd_items.rows * button_h > r_items.h) if(num_rows_needed * button_h > r_items.h)
{ {
// too many; we'll need scroll buttons // too many; we'll need scroll buttons
r_items.h -= button_h; r_items.h -= button_h;
r_items.y += button_h/2; r_items.y += button_h/2;
gd_items.rows = r_items.h / button_h;
} }
gd_items.rows = r_items.h / button_h;
if(HIT(r_items)) if(HIT(r_items))
{ {