Commit acb526c8 authored by BST 1998  Austin Donnelly's avatar BST 1998 Austin Donnelly Committed by Austin Donnelly

don't bail if we don't have a source drawable if we're actually using a

Sun Oct 18 21:20:25 BST 1998  Austin Donnelly  <austin@greenend.org.uk>

	* app/clone.c: don't bail if we don't have a source drawable if
	we're actually using a pattern as source.
parent a701767f
......@@ -315,7 +315,7 @@ clone_motion (PaintCore *paint_core,
int offset_y)
{
GImage *gimage;
GImage *src_gimage;
GImage *src_gimage = NULL;
unsigned char * s;
unsigned char * d;
TempBuf * orig;
......@@ -323,26 +323,32 @@ clone_motion (PaintCore *paint_core,
void * pr;
int y;
int x1, y1, x2, y2;
int has_alpha;
int has_alpha = -1;
PixelRegion srcPR, destPR;
GPatternP pattern;
pr = NULL;
pattern = NULL;
/* Make sure we still have a source! */
if (!src_drawable ||
(! (src_gimage = drawable_gimage (src_drawable)) && type == ImageClone) ||
! (gimage = drawable_gimage (drawable)))
/* Make sure we still have a source if we are doing image cloning */
if (type == ImageClone)
{
if (!src_drawable)
return;
if (! (src_gimage = drawable_gimage (src_drawable)))
return;
/* Determine whether the source image has an alpha channel */
has_alpha = drawable_has_alpha (src_drawable);
}
/* We always need a destination image */
if (! (gimage = drawable_gimage (drawable)))
return;
/* Get a region which can be used to paint to */
if (! (area = paint_core_get_paint_area (paint_core, drawable)))
return;
/* Determine whether the source image has an alpha channel */
has_alpha = drawable_has_alpha (src_drawable);
switch (type)
{
case ImageClone:
......
......@@ -315,7 +315,7 @@ clone_motion (PaintCore *paint_core,
int offset_y)
{
GImage *gimage;
GImage *src_gimage;
GImage *src_gimage = NULL;
unsigned char * s;
unsigned char * d;
TempBuf * orig;
......@@ -323,26 +323,32 @@ clone_motion (PaintCore *paint_core,
void * pr;
int y;
int x1, y1, x2, y2;
int has_alpha;
int has_alpha = -1;
PixelRegion srcPR, destPR;
GPatternP pattern;
pr = NULL;
pattern = NULL;
/* Make sure we still have a source! */
if (!src_drawable ||
(! (src_gimage = drawable_gimage (src_drawable)) && type == ImageClone) ||
! (gimage = drawable_gimage (drawable)))
/* Make sure we still have a source if we are doing image cloning */
if (type == ImageClone)
{
if (!src_drawable)
return;
if (! (src_gimage = drawable_gimage (src_drawable)))
return;
/* Determine whether the source image has an alpha channel */
has_alpha = drawable_has_alpha (src_drawable);
}
/* We always need a destination image */
if (! (gimage = drawable_gimage (drawable)))
return;
/* Get a region which can be used to paint to */
if (! (area = paint_core_get_paint_area (paint_core, drawable)))
return;
/* Determine whether the source image has an alpha channel */
has_alpha = drawable_has_alpha (src_drawable);
switch (type)
{
case ImageClone:
......
......@@ -315,7 +315,7 @@ clone_motion (PaintCore *paint_core,
int offset_y)
{
GImage *gimage;
GImage *src_gimage;
GImage *src_gimage = NULL;
unsigned char * s;
unsigned char * d;
TempBuf * orig;
......@@ -323,26 +323,32 @@ clone_motion (PaintCore *paint_core,
void * pr;
int y;
int x1, y1, x2, y2;
int has_alpha;
int has_alpha = -1;
PixelRegion srcPR, destPR;
GPatternP pattern;
pr = NULL;
pattern = NULL;
/* Make sure we still have a source! */
if (!src_drawable ||
(! (src_gimage = drawable_gimage (src_drawable)) && type == ImageClone) ||
! (gimage = drawable_gimage (drawable)))
/* Make sure we still have a source if we are doing image cloning */
if (type == ImageClone)
{
if (!src_drawable)
return;
if (! (src_gimage = drawable_gimage (src_drawable)))
return;
/* Determine whether the source image has an alpha channel */
has_alpha = drawable_has_alpha (src_drawable);
}
/* We always need a destination image */
if (! (gimage = drawable_gimage (drawable)))
return;
/* Get a region which can be used to paint to */
if (! (area = paint_core_get_paint_area (paint_core, drawable)))
return;
/* Determine whether the source image has an alpha channel */
has_alpha = drawable_has_alpha (src_drawable);
switch (type)
{
case ImageClone:
......
......@@ -315,7 +315,7 @@ clone_motion (PaintCore *paint_core,
int offset_y)
{
GImage *gimage;
GImage *src_gimage;
GImage *src_gimage = NULL;
unsigned char * s;
unsigned char * d;
TempBuf * orig;
......@@ -323,26 +323,32 @@ clone_motion (PaintCore *paint_core,
void * pr;
int y;
int x1, y1, x2, y2;
int has_alpha;
int has_alpha = -1;
PixelRegion srcPR, destPR;
GPatternP pattern;
pr = NULL;
pattern = NULL;
/* Make sure we still have a source! */
if (!src_drawable ||
(! (src_gimage = drawable_gimage (src_drawable)) && type == ImageClone) ||
! (gimage = drawable_gimage (drawable)))
/* Make sure we still have a source if we are doing image cloning */
if (type == ImageClone)
{
if (!src_drawable)
return;
if (! (src_gimage = drawable_gimage (src_drawable)))
return;
/* Determine whether the source image has an alpha channel */
has_alpha = drawable_has_alpha (src_drawable);
}
/* We always need a destination image */
if (! (gimage = drawable_gimage (drawable)))
return;
/* Get a region which can be used to paint to */
if (! (area = paint_core_get_paint_area (paint_core, drawable)))
return;
/* Determine whether the source image has an alpha channel */
has_alpha = drawable_has_alpha (src_drawable);
switch (type)
{
case ImageClone:
......
......@@ -315,7 +315,7 @@ clone_motion (PaintCore *paint_core,
int offset_y)
{
GImage *gimage;
GImage *src_gimage;
GImage *src_gimage = NULL;
unsigned char * s;
unsigned char * d;
TempBuf * orig;
......@@ -323,26 +323,32 @@ clone_motion (PaintCore *paint_core,
void * pr;
int y;
int x1, y1, x2, y2;
int has_alpha;
int has_alpha = -1;
PixelRegion srcPR, destPR;
GPatternP pattern;
pr = NULL;
pattern = NULL;
/* Make sure we still have a source! */
if (!src_drawable ||
(! (src_gimage = drawable_gimage (src_drawable)) && type == ImageClone) ||
! (gimage = drawable_gimage (drawable)))
/* Make sure we still have a source if we are doing image cloning */
if (type == ImageClone)
{
if (!src_drawable)
return;
if (! (src_gimage = drawable_gimage (src_drawable)))
return;
/* Determine whether the source image has an alpha channel */
has_alpha = drawable_has_alpha (src_drawable);
}
/* We always need a destination image */
if (! (gimage = drawable_gimage (drawable)))
return;
/* Get a region which can be used to paint to */
if (! (area = paint_core_get_paint_area (paint_core, drawable)))
return;
/* Determine whether the source image has an alpha channel */
has_alpha = drawable_has_alpha (src_drawable);
switch (type)
{
case ImageClone:
......
......@@ -315,7 +315,7 @@ clone_motion (PaintCore *paint_core,
int offset_y)
{
GImage *gimage;
GImage *src_gimage;
GImage *src_gimage = NULL;
unsigned char * s;
unsigned char * d;
TempBuf * orig;
......@@ -323,26 +323,32 @@ clone_motion (PaintCore *paint_core,
void * pr;
int y;
int x1, y1, x2, y2;
int has_alpha;
int has_alpha = -1;
PixelRegion srcPR, destPR;
GPatternP pattern;
pr = NULL;
pattern = NULL;
/* Make sure we still have a source! */
if (!src_drawable ||
(! (src_gimage = drawable_gimage (src_drawable)) && type == ImageClone) ||
! (gimage = drawable_gimage (drawable)))
/* Make sure we still have a source if we are doing image cloning */
if (type == ImageClone)
{
if (!src_drawable)
return;
if (! (src_gimage = drawable_gimage (src_drawable)))
return;
/* Determine whether the source image has an alpha channel */
has_alpha = drawable_has_alpha (src_drawable);
}
/* We always need a destination image */
if (! (gimage = drawable_gimage (drawable)))
return;
/* Get a region which can be used to paint to */
if (! (area = paint_core_get_paint_area (paint_core, drawable)))
return;
/* Determine whether the source image has an alpha channel */
has_alpha = drawable_has_alpha (src_drawable);
switch (type)
{
case ImageClone:
......
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