fixed the GIMP_ZOOM_TO case for palettes with a number of colors that is

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

	* app/widgets/gimppaletteeditor.c (gimp_palette_editor_zoom):
	fixed the GIMP_ZOOM_TO case for palettes with a number of colors
	that is not a multiple of the number of columns.
This commit is contained in:
Sven Neumann 2005-07-22 08:19:05 +00:00 committed by Sven Neumann
parent 222d5a8935
commit afc7754c9e
2 changed files with 12 additions and 7 deletions

View File

@ -1,3 +1,9 @@
2005-07-22 Sven Neumann <sven@gimp.org>
* app/widgets/gimppaletteeditor.c (gimp_palette_editor_zoom):
fixed the GIMP_ZOOM_TO case for palettes with a number of colors
that is not a multiple of the number of columns.
2005-07-22 Sven Neumann <sven@gimp.org>
* app/widgets/gimpviewrendererpalette.c

View File

@ -545,17 +545,16 @@ gimp_palette_editor_zoom (GimpPaletteEditor *editor,
zoom_factor -= 0.1;
break;
case GIMP_ZOOM_TO: /* abused as ZOOM_ALL */
case GIMP_ZOOM_TO: /* used as ZOOM_ALL */
{
gint height;
gint height = editor->view->parent->parent->parent->allocation.height;
gint columns = palette->n_columns ? palette->n_columns : COLUMNS;
gint rows;
height = editor->view->parent->parent->parent->allocation.height;
rows = palette->n_colors / columns;
if (palette->n_columns)
rows = palette->n_colors / palette->n_columns;
else
rows = palette->n_colors / COLUMNS;
if (palette->n_colors % columns)
rows += 1;
rows = MAX (1, rows);