From ba76bdce028570e0d8d5dd8c28f8ec1335723a65 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Wed, 11 Mar 2015 09:11:47 +0000 Subject: [PATCH] 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 --- src/Fl_Shared_Image.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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_;