summaryrefslogtreecommitdiff
path: root/test/offscreen.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2017-08-15 14:52:50 +0000
committerManolo Gouy <Manolo>2017-08-15 14:52:50 +0000
commitd42e7374a5ff1badab0e8ff38ce21a3fcc7a259f (patch)
tree12d228e229577051d4d9c914fa8f47265e34a359 /test/offscreen.cxx
parent108a5e8de2b4a3e0f1a4c681028685912c7d8c18 (diff)
Update support of rescaling which no longer involves hide/show of the window.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12385 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'test/offscreen.cxx')
-rw-r--r--test/offscreen.cxx9
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())
{