summaryrefslogtreecommitdiff
path: root/src/Fl_Image.cxx
diff options
context:
space:
mode:
authorAlbrecht Schlosser <albrechts.fltk@online.de>2022-03-20 19:59:22 +0100
committerAlbrecht Schlosser <albrechts.fltk@online.de>2022-04-13 16:50:30 +0200
commit10537b7143a06a4c0c1c4caba4f0150f9e290090 (patch)
treed265896f0d66a20391cbeb55b0f133fb3f1a90ca /src/Fl_Image.cxx
parent95b5623b96e37e46ef80e75326453ea840172ce7 (diff)
Make Fl_Image::copy() 'const', including all derived classes
Copying an image does not (and must not) change the original object, hence copy() should always be 'const'. This is *necessary* if the given Fl_Image object is 'const'.
Diffstat (limited to 'src/Fl_Image.cxx')
-rw-r--r--src/Fl_Image.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Fl_Image.cxx b/src/Fl_Image.cxx
index eba5b2001..3ff657b92 100644
--- a/src/Fl_Image.cxx
+++ b/src/Fl_Image.cxx
@@ -88,7 +88,7 @@ void Fl_Image::draw_empty(int X, int Y) {
\param[in] W,H Requested width and height of the copied image
*/
-Fl_Image *Fl_Image::copy(int W, int H) {
+Fl_Image *Fl_Image::copy(int W, int H) const {
return new Fl_Image(W, H, d());
}
@@ -401,7 +401,7 @@ void Fl_RGB_Image::uncache() {
Fl_Graphics_Driver::default_driver().uncache(this, id_, mask_);
}
-Fl_Image *Fl_RGB_Image::copy(int W, int H) {
+Fl_Image *Fl_RGB_Image::copy(int W, int H) const {
Fl_RGB_Image *new_image; // New RGB image
uchar *new_array; // New array for image data