diff options
| author | Manolo Gouy <Manolo> | 2014-07-10 12:28:00 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2014-07-10 12:28:00 +0000 |
| commit | 677e13f2bb12a16cb94303fcbcdf7d7f0a5adaba (patch) | |
| tree | 05522025edc9adda94b4eb7ed731428168a1e67d | |
| parent | b18dd182d092c21a47b5754de3fcd0f2fb17a8ce (diff) | |
Fix for STR #3106: a tiled image could fail if the size of the tiled surface exceeded the size of the main screen.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10218 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
| -rw-r--r-- | src/Fl_Tiled_Image.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/Fl_Tiled_Image.cxx b/src/Fl_Tiled_Image.cxx index 241094bad..4d88cf8bc 100644 --- a/src/Fl_Tiled_Image.cxx +++ b/src/Fl_Tiled_Image.cxx @@ -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); |
