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
This commit is contained in:
Manolo Gouy 2017-08-15 14:52:50 +00:00
parent 108a5e8de2
commit d42e7374a5

View File

@ -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())
{