From fa83d8be3a6541d9b1a1be31f698c5df3470a8b7 Mon Sep 17 00:00:00 2001 From: dirk Date: Sat, 11 Jan 2014 11:41:23 +0000 Subject: [PATCH] Fixed changing fillPattern in floodFillTexture. --- Magick++/lib/Image.cpp | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/Magick++/lib/Image.cpp b/Magick++/lib/Image.cpp index 060741243..e9c628135 100644 --- a/Magick++/lib/Image.cpp +++ b/Magick++/lib/Image.cpp @@ -2857,12 +2857,23 @@ void Magick::Image::floodFillTexture(const Magick::Geometry &point_, void Magick::Image::floodFillTexture(const ssize_t x_,const ssize_t y_, const Magick::Image &texture_) { + MagickCore::Image + *fillPattern; + Quantum *p; modifyImage(); - // Set drawing pattern + // Set drawing fill pattern + fillPattern=(MagickCore::Image *)NULL; + if (options()->fillPattern() != (MagickCore::Image *)NULL) + { + GetPPException; + fillPattern=CloneImage(options()->fillPattern(),0,0,MagickTrue, + &exceptionInfo); + ThrowPPException; + } options()->fillPattern(texture_.constImage()); // Get pixel view @@ -2883,8 +2894,11 @@ void Magick::Image::floodFillTexture(const ssize_t x_,const ssize_t y_, FloodfillPaintImage(image(),options()->drawInfo(),&target, static_cast(x_),static_cast(y_),MagickFalse, &exceptionInfo); + options()->fillPattern(fillPattern); ThrowPPException; } + else + options()->fillPattern(fillPattern); } void Magick::Image::floodFillTexture(const Magick::Geometry &point_, @@ -2896,12 +2910,23 @@ void Magick::Image::floodFillTexture(const Magick::Geometry &point_, void Magick::Image::floodFillTexture(const ssize_t x_,const ssize_t y_, const Magick::Image &texture_,const Magick::Color &borderColor_) { + MagickCore::Image + *fillPattern; + PixelInfo target; modifyImage(); // Set drawing fill pattern + fillPattern=(MagickCore::Image *)NULL; + if (options()->fillPattern() != (MagickCore::Image *)NULL) + { + GetPPException; + fillPattern=CloneImage(options()->fillPattern(),0,0,MagickTrue, + &exceptionInfo); + ThrowPPException; + } options()->fillPattern(texture_.constImage()); GetPixelInfo(constImage(),&target); @@ -2912,6 +2937,7 @@ void Magick::Image::floodFillTexture(const ssize_t x_,const ssize_t y_, FloodfillPaintImage(image(),options()->drawInfo(),&target, static_cast(x_),static_cast(y_),MagickTrue, &exceptionInfo); + options()->fillPattern(fillPattern); ThrowPPException; } -- 2.50.1