summaryrefslogtreecommitdiff
path: root/FL/Fl_SVG_Image.H
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 /FL/Fl_SVG_Image.H
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 'FL/Fl_SVG_Image.H')
-rw-r--r--FL/Fl_SVG_Image.H10
1 files changed, 6 insertions, 4 deletions
diff --git a/FL/Fl_SVG_Image.H b/FL/Fl_SVG_Image.H
index 2f98a2a46..d09f3882b 100644
--- a/FL/Fl_SVG_Image.H
+++ b/FL/Fl_SVG_Image.H
@@ -147,16 +147,18 @@ private:
float svg_scaling_(int W, int H);
void rasterize_(int W, int H);
virtual void cache_size_(int &width, int &height);
- void init_(const char *filename, const char *filedata, Fl_SVG_Image *copy_source);
- Fl_SVG_Image(Fl_SVG_Image *source);
+ void init_(const char *filename, const char *filedata, const Fl_SVG_Image *copy_source);
+ Fl_SVG_Image(const Fl_SVG_Image *source);
public:
/** Set this to \c false to allow image re-scaling that alters the image aspect ratio.
Upon object creation, proportional is set to \c true, and the aspect ratio is kept constant.*/
bool proportional;
Fl_SVG_Image(const char *filename, const char *svg_data = NULL);
virtual ~Fl_SVG_Image();
- virtual Fl_Image *copy(int W, int H);
- Fl_Image *copy() { return Fl_Image::copy(); }
+ virtual Fl_Image *copy(int W, int H) const;
+ Fl_Image *copy() const {
+ return Fl_Image::copy();
+ }
void resize(int width, int height);
virtual void desaturate();
virtual void color_average(Fl_Color c, float i);