diff options
Diffstat (limited to 'test/offscreen.cxx')
| -rw-r--r-- | test/offscreen.cxx | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test/offscreen.cxx b/test/offscreen.cxx index bcb140f49..43932fb60 100644 --- a/test/offscreen.cxx +++ b/test/offscreen.cxx @@ -96,6 +96,11 @@ void oscr_box::draw() // then add the offscreen on top of the grey background if (has_oscr()) // offscreen exists { + if (scale != Fl_Graphics_Driver::default_driver().scale()) { + // the screen scaling factor has changed + fl_scale_offscreen(oscr); + scale = Fl_Graphics_Driver::default_driver().scale(); + } fl_copy_offscreen(xo, yo, wd, ht, oscr, page_x, page_y); } else // create offscreen @@ -105,6 +110,7 @@ void oscr_box::draw() offsc_w = offscreen_size; offsc_h = offscreen_size; oscr = fl_create_offscreen(offsc_w, offsc_h); + scale = Fl_Graphics_Driver::default_driver().scale(); } } // draw method @@ -113,9 +119,6 @@ int oscr_box::handle(int ev) { int ret = Fl_Box::handle(ev); - if (ev == FL_HIDE && oscr) { - fl_scale_offscreen(oscr); - } // handle dragging of visible page area - if a valid context exists if (has_oscr()) { |
