summaryrefslogtreecommitdiff
path: root/src/Fl_Pixmap.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/Fl_Pixmap.cxx')
-rw-r--r--src/Fl_Pixmap.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/Fl_Pixmap.cxx b/src/Fl_Pixmap.cxx
index 1fbd68a74..6b768d8f9 100644
--- a/src/Fl_Pixmap.cxx
+++ b/src/Fl_Pixmap.cxx
@@ -1,5 +1,5 @@
//
-// "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.32 2004/08/31 22:00:47 matthiaswm Exp $"
+// "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.33 2004/09/24 16:00:10 easysw Exp $"
//
// Pixmap drawing code for the Fast Light Tool Kit (FLTK).
//
@@ -233,12 +233,18 @@ void Fl_Pixmap::copy_data() {
}
Fl_Image *Fl_Pixmap::copy(int W, int H) {
+ Fl_Pixmap *new_image; // New pixmap
+
// Optimize the simple copy where the width and height are the same...
- if (W == w() && H == h()) return new Fl_Pixmap(data());
+ if (W == w() && H == h()) {
+ // Make an exact copy of the image and return it...
+ new_image = new Fl_Pixmap(data());
+ new_image->copy_data();
+ return new_image;
+ }
if (W <= 0 || H <= 0) return 0;
// OK, need to resize the image data; allocate memory and
- Fl_Pixmap *new_image; // New pixmap
char **new_data, // New array for image data
**new_row, // Pointer to row in image data
*new_ptr, // Pointer into new array
@@ -473,5 +479,5 @@ void Fl_Pixmap::desaturate() {
}
//
-// End of "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.32 2004/08/31 22:00:47 matthiaswm Exp $".
+// End of "$Id: Fl_Pixmap.cxx,v 1.9.2.4.2.33 2004/09/24 16:00:10 easysw Exp $".
//