when dropping an indexed layer onto the toolbox, copy the colormap

to the newly created image (fixes bug #5692)


--Sven
This commit is contained in:
Sven Neumann 2000-01-31 18:37:36 +00:00
parent 165368cfaf
commit 682abba9eb
4 changed files with 26 additions and 6 deletions

View File

@ -1,3 +1,8 @@
Tue Feb 1 17:30:52 CET 2000 Sven Neumann <sven@gimp.org>
* app/interface.c: when dropping an indexed layer onto the toolbox,
copy the colormap to the newly created image (fixes bug #5692)
Tue Feb 1 14:46:43 CET 2000 Sven Neumann <sven@gimp.org>
* app/gimpdrawable.c: check that the passed pointer is indeed a

View File

@ -1141,8 +1141,13 @@ toolbox_drag_drop (GtkWidget *widget,
new_gimage = gimage_new (width, height, type);
gimage_disable_undo (new_gimage);
gimage_set_resolution (new_gimage,
gimage->xresolution, gimage->yresolution);
if (type == INDEXED) /* copy the colormap */
{
new_gimage->num_cols = gimage->num_cols;
memcpy (new_gimage->cmap, gimage->cmap, COLORMAP_SIZE);
}
gimage_set_resolution (new_gimage, gimage->xresolution, gimage->yresolution);
gimage_set_unit (new_gimage, gimage->unit);
if (layer)

View File

@ -1141,8 +1141,13 @@ toolbox_drag_drop (GtkWidget *widget,
new_gimage = gimage_new (width, height, type);
gimage_disable_undo (new_gimage);
gimage_set_resolution (new_gimage,
gimage->xresolution, gimage->yresolution);
if (type == INDEXED) /* copy the colormap */
{
new_gimage->num_cols = gimage->num_cols;
memcpy (new_gimage->cmap, gimage->cmap, COLORMAP_SIZE);
}
gimage_set_resolution (new_gimage, gimage->xresolution, gimage->yresolution);
gimage_set_unit (new_gimage, gimage->unit);
if (layer)

View File

@ -1141,8 +1141,13 @@ toolbox_drag_drop (GtkWidget *widget,
new_gimage = gimage_new (width, height, type);
gimage_disable_undo (new_gimage);
gimage_set_resolution (new_gimage,
gimage->xresolution, gimage->yresolution);
if (type == INDEXED) /* copy the colormap */
{
new_gimage->num_cols = gimage->num_cols;
memcpy (new_gimage->cmap, gimage->cmap, COLORMAP_SIZE);
}
gimage_set_resolution (new_gimage, gimage->xresolution, gimage->yresolution);
gimage_set_unit (new_gimage, gimage->unit);
if (layer)