Replace virtual Fl_RGB_Image::cache_size() by virtual Fl_Image::cache_size()

This commit is contained in:
ManoloFLTK
2020-11-17 11:23:24 +01:00
parent 1a1ce33751
commit 2931c29689
2 changed files with 3 additions and 5 deletions
+2 -1
View File
@@ -75,6 +75,8 @@ private:
// Forbid use of copy constructor and assign operator
Fl_Image & operator=(const Fl_Image &);
Fl_Image(const Fl_Image &);
// Presently redefined in Fl_SVG_Image
virtual void cache_size(int &width, int &height) {}
protected:
@@ -302,7 +304,6 @@ private:
fl_uintptr_t id_;
fl_uintptr_t mask_;
int cache_w_, cache_h_; // size of image when cached
virtual void cache_size(int &width, int &height) {}
public:
Fl_RGB_Image(const uchar *bits, int W, int H, int D=3, int LD=0);
+1 -4
View File
@@ -210,10 +210,7 @@ void Fl_Graphics_Driver::cache_size(Fl_Image *img, int &width, int &height)
width = (width+1) * scale();
height = (height+1) * scale();
}
if (img->d() == 4) { // check for depth-4 RGB image
Fl_RGB_Image *rgb = (Fl_RGB_Image*)img;
rgb->cache_size(width, height);
}
img->cache_size(width, height);
}
/** Draws an Fl_Pixmap object using this graphics driver.