Commit 222d5a89 authored by Sven Neumann's avatar Sven Neumann Committed by Sven Neumann

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.
parent 772b47db
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
......
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment