summaryrefslogtreecommitdiff
path: root/src/Fl_Tiled_Image.cxx
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-06-20 12:49:38 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2022-06-20 12:49:38 +0200
commite698af035a8d9363ac6d212a8e986e1f4fdac969 (patch)
tree8b1d03c65220a09219c614b18eea10014536cae2 /src/Fl_Tiled_Image.cxx
parent02870242eea8b729b3dbd6d23eb77372f61c6318 (diff)
Fix issue #427 - 2nd part
Fix Fl_Tiled_Image made from scaled source image. Fix Fl_Shared_Image::update() to allow scaled source image. Correct handling of default value (-1) of 3rd argument of 3-argument Fl_BMP_Image constructor.
Diffstat (limited to 'src/Fl_Tiled_Image.cxx')
-rw-r--r--src/Fl_Tiled_Image.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Fl_Tiled_Image.cxx b/src/Fl_Tiled_Image.cxx
index da1ed5531..2ec62e79a 100644
--- a/src/Fl_Tiled_Image.cxx
+++ b/src/Fl_Tiled_Image.cxx
@@ -92,7 +92,9 @@ void
Fl_Tiled_Image::color_average(Fl_Color c, // I - Color to blend with
float i) { // I - Blend fraction
if (!alloc_image_) {
- image_ = image_->copy();
+ int W = image_->w(), H = image_->h();
+ image_ = image_->copy(image_->data_w(), image_->data_h());
+ image_->scale(W, H, 0, 1);
alloc_image_ = 1;
}
@@ -107,7 +109,9 @@ Fl_Tiled_Image::color_average(Fl_Color c, // I - Color to blend with
void
Fl_Tiled_Image::desaturate() {
if (!alloc_image_) {
- image_ = image_->copy();
+ int W = image_->w(), H = image_->h();
+ image_ = image_->copy(image_->data_w(), image_->data_h());
+ image_->scale(W, H, 0, 1);
alloc_image_ = 1;
}