applied patch from Brion Vibber that adds an alpha channel to the pasted

2004-12-12  Sven Neumann  <sven@gimp.org>

	* plug-ins/common/winclipboard.c: applied patch from Brion Vibber
	that adds an alpha channel to the pasted layer. Fixes bug #148601.
This commit is contained in:
Sven Neumann 2004-12-12 14:43:22 +00:00 committed by Sven Neumann
parent 5b45188c57
commit 75c5adf3bb
2 changed files with 11 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2004-12-12 Sven Neumann <sven@gimp.org>
* plug-ins/common/winclipboard.c: applied patch from Brion Vibber
that adds an alpha channel to the pasted layer. Fixes bug #148601.
2004-12-12 Sven Neumann <sven@gimp.org>
* app/base/tile-manager-crop.c: removed trailing whitespace.

View file

@ -585,7 +585,7 @@ CB_PasteImage (gboolean interactive,
/* ??? gimp_image_convert_rgb (image_ID);
*/
drawable_ID = gimp_layer_new (image_ID, _("Pasted"), nWidth, nHeight,
nBitsPS <= 8 ? GIMP_INDEXED_IMAGE : GIMP_RGB_IMAGE,
nBitsPS <= 8 ? GIMP_INDEXEDA_IMAGE : GIMP_RGBA_IMAGE,
100, GIMP_NORMAL_MODE);
bIsNewImage = FALSE;
}
@ -647,6 +647,8 @@ CB_PasteImage (gboolean interactive,
pLine[x*drawable->bpp] = pData[y*nSizeLine+x*bps+2];
pLine[x*drawable->bpp+1] = pData[y*nSizeLine+x*bps+1];
pLine[x*drawable->bpp+2] = pData[y*nSizeLine+x*bps];
if (drawable->bpp == 4)
pLine[x*drawable->bpp+3] = 255;
}
else
for (x = 0; x < drawable->width; x++)
@ -660,6 +662,8 @@ CB_PasteImage (gboolean interactive,
pLine[x*drawable->bpp] = (255 * ((dw & maskR) >> shiftR)) / maxR;
pLine[x*drawable->bpp+1] = (255 * ((dw & maskG) >> shiftG)) / maxG;
pLine[x*drawable->bpp+2] = (255 * ((dw & maskB) >> shiftB)) / maxB;
if (drawable->bpp == 4)
pLine[x*drawable->bpp+3] = 255;
}
/* copy data to GIMP */
@ -671,6 +675,7 @@ CB_PasteImage (gboolean interactive,
{
int y;
/* copy line by line */
/* This will only be reached for new images, so no need for alpha */
for (y = 0; y < drawable->height; y++)
{
if ((interactive) && (StepProgress (y, drawable->height)))