summaryrefslogtreecommitdiff
path: root/src/Fl_Shared_Image.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2015-03-11 09:11:47 +0000
committerManolo Gouy <Manolo>2015-03-11 09:11:47 +0000
commitba76bdce028570e0d8d5dd8c28f8ec1335723a65 (patch)
tree371f109acc4aa7ef5e2a47bc627bd7397cacc301 /src/Fl_Shared_Image.cxx
parente69467bbc95e699a7e140d73b3f9b58f97f79eaa (diff)
Implementation of Fl_Shared_Image::scale(width, height) for scaled image drawing - cont'd
don't call Fl_Graphics_Driver::draw_scaled(Fl_Image*,...) for an enlarged Fl_Bitmap or Fl_Pixmap git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10617 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Shared_Image.cxx')
-rw-r--r--src/Fl_Shared_Image.cxx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/Fl_Shared_Image.cxx b/src/Fl_Shared_Image.cxx
index 3c2aa4b85..16181e9a8 100644
--- a/src/Fl_Shared_Image.cxx
+++ b/src/Fl_Shared_Image.cxx
@@ -338,7 +338,11 @@ void Fl_Shared_Image::draw(int X, int Y, int W, int H, int cx, int cy) {
return;
}
fl_push_clip(X, Y, W, H);
- int done = fl_graphics_driver->draw_scaled(image_, X-cx, Y-cy, w(), h());
+ int done = 0;
+ // don't call Fl_Graphics_Driver::draw_scaled(Fl_Image*,...) for an enlarged Fl_Bitmap or Fl_Pixmap
+ if ((d() != 0 && count() < 2) || (w() <= image_->w() && h() <= image_->h())) {
+ done = fl_graphics_driver->draw_scaled(image_, X-cx, Y-cy, w(), h());
+ }
if (!done) {
if (scaled_image_ && (scaled_image_->w() != w() || scaled_image_->h() != h())) {
delete scaled_image_;