reverted my last change here and replaced it with a better fix.

2005-07-22  Sven Neumann  <sven@gimp.org>

	* app/widgets/gimpviewrendererpalette.c
	(gimp_view_renderer_palette_render): reverted my last change here
	and replaced it with a better fix.
This commit is contained in:
Sven Neumann 2005-07-22 08:09:40 +00:00 committed by Sven Neumann
parent 772b47db6a
commit 222d5a8935
2 changed files with 12 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2005-07-22 Sven Neumann <sven@gimp.org>
* app/widgets/gimpviewrendererpalette.c
(gimp_view_renderer_palette_render): reverted my last change here
and replaced it with a better fix.
2005-07-22 Michael Natterer <mitch@gimp.org>
* app/widgets/gimppaletteview.c: setup the dnd stuff in

View File

@ -114,6 +114,9 @@ gimp_view_renderer_palette_render (GimpViewRenderer *renderer,
palette = GIMP_PALETTE (renderer->viewable);
if (palette->n_colors < 1)
return;
if (! renderer->buffer)
renderer->buffer = g_new (guchar, renderer->height * renderer->rowstride);
@ -137,14 +140,15 @@ gimp_view_renderer_palette_render (GimpViewRenderer *renderer,
renderpal->columns = renderer->width / renderpal->cell_width;
renderpal->rows = MAX (1, palette->n_colors / renderpal->columns);
renderpal->rows = palette->n_colors / renderpal->columns;
if (palette->n_colors % renderpal->columns)
renderpal->rows += 1;
renderpal->cell_height = MAX (4, renderer->height / renderpal->rows);
if (! renderpal->draw_grid)
renderpal->cell_height = MIN (renderpal->cell_height, renderpal->cell_width);
renderpal->cell_height = MIN (renderpal->cell_height,
renderpal->cell_width);
list = palette->colors;