diff options
author | Aaron M. Ucko <ucko@debian.org> | 2015-07-06 18:51:56 -0400 |
---|---|---|
committer | Aaron M. Ucko <ucko@debian.org> | 2015-07-06 18:51:56 -0400 |
commit | a3d0ced57399c9fd8075377b7310d545f968e524 (patch) | |
tree | 63fa5d8b883c8c1235222810a0ebc99c74ac6610 /src/Fl_Tiled_Image.cxx | |
parent | 786f49e9d19180e6bf1c7d0fe0d9da89f953a330 (diff) |
Imported Upstream version 1.3.3
Diffstat (limited to 'src/Fl_Tiled_Image.cxx')
-rw-r--r-- | src/Fl_Tiled_Image.cxx | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/Fl_Tiled_Image.cxx b/src/Fl_Tiled_Image.cxx index d708742..2f459ea 100644 --- a/src/Fl_Tiled_Image.cxx +++ b/src/Fl_Tiled_Image.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Tiled_Image.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $" +// "$Id: Fl_Tiled_Image.cxx 10218 2014-07-10 12:28:00Z manolo $" // // Tiled image code for the Fast Light Tool Kit (FLTK). // @@ -19,6 +19,7 @@ #include <FL/Fl.H> #include <FL/Fl_Tiled_Image.H> +#include <FL/Fl_Window.H> #include <FL/fl_draw.H> /** @@ -31,9 +32,10 @@ Fl_Tiled_Image::Fl_Tiled_Image(Fl_Image *i, // I - Image to tile Fl_Image(W,H,0) { image_ = i; alloc_image_ = 0; - - if (W == 0) w(Fl::w()); - if (H == 0) h(Fl::h()); + // giving to the tiled image the screen size may fail with multiscreen configurations + // so we leave it with w = h = 0 (STR #3106) + /* if (W == 0) w(Fl::w()); + if (H == 0) h(Fl::h());*/ } /** The destructor frees all memory and server resources that are used by @@ -99,8 +101,11 @@ Fl_Tiled_Image::draw(int X, // I - Starting X position int cx, // I - "Source" X position int cy) { // I - "Source" Y position if (!image_->w() || !image_->h()) return; - if (W == 0) W = Fl::w(); - if (H == 0) H = Fl::h(); + if (W == 0 && H == 0 && Fl_Window::current()) { // W and H null means the image is potentially as large as the current window + W = Fl_Window::current()->w(); + H = Fl_Window::current()->h(); + X = Y = 0; + } fl_push_clip(X, Y, W, H); @@ -122,5 +127,5 @@ Fl_Tiled_Image::draw(int X, // I - Starting X position // -// End of "$Id: Fl_Tiled_Image.cxx 8864 2011-07-19 04:49:30Z greg.ercolano $". +// End of "$Id: Fl_Tiled_Image.cxx 10218 2014-07-10 12:28:00Z manolo $". // |