Override virtual function Fl_Image::scale(int,int) for class Fl_SVG_Image.

An SVG image has no intrinsic size, so it makes no sense to prohibit enlarging it beyond an intrinsic size.
This commit is contained in:
ManoloFLTK
2026-03-27 17:10:35 +01:00
parent d8b9180dc7
commit ed2238bc2a
2 changed files with 6 additions and 0 deletions
+1
View File
@@ -172,6 +172,7 @@ public:
Fl_SVG_Image *as_svg_image() override { return this; }
const Fl_SVG_Image *as_svg_image() const override { return this; }
void normalize() override;
void scale(int w, int h, int keep_aspect = 1, int can_expand = 0) override;
};
#endif // FL_SVG_IMAGE_H
+5
View File
@@ -412,4 +412,9 @@ void Fl_SVG_Image::normalize() {
if (!array) resize(w(), h());
}
void Fl_SVG_Image::scale(int w, int h, int keep_aspect, int can_expand) {
Fl_Image::scale(w, h, keep_aspect, 1);
}
#endif // FLTK_USE_SVG