summaryrefslogtreecommitdiff
path: root/src/Fl_Bitmap.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2017-08-30 15:49:58 +0000
committerManolo Gouy <Manolo>2017-08-30 15:49:58 +0000
commiteae09e7fa09c6a00988653ed67fe0d82f1861bff (patch)
treefb6294b229eecc8222a6aae71a0790c9941be1ca /src/Fl_Bitmap.cxx
parent1b7750913328829c2d3c7f99b36b3a44758e69a2 (diff)
Create virtual Fl_Image::draw_scaled_(int X, int Y, int W, int H) and its implementations for image classes.
This allows to use the virtual function mechanism to adapt scaled image drawing both to the image type and the graphics driver type. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12410 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_Bitmap.cxx')
-rw-r--r--src/Fl_Bitmap.cxx5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Fl_Bitmap.cxx b/src/Fl_Bitmap.cxx
index 450886d38..9baacf321 100644
--- a/src/Fl_Bitmap.cxx
+++ b/src/Fl_Bitmap.cxx
@@ -232,6 +232,11 @@ Fl_Image *Fl_Bitmap::copy(int W, int H) {
}
+int Fl_Bitmap::draw_scaled_(int X, int Y, int W, int H) {
+ return (W <= w() && H <= h()) ? fl_graphics_driver->draw_scaled(this, X, Y, W, H) : 0;
+}
+
+
//
// End of "$Id$".
//