diff options
| author | Manolo Gouy <Manolo> | 2016-12-07 15:09:52 +0000 |
|---|---|---|
| committer | Manolo Gouy <Manolo> | 2016-12-07 15:09:52 +0000 |
| commit | 43935dffeb7cb54a97b2a8a610c2e453743c0da9 (patch) | |
| tree | 9f132039b9cf120263bf03965c152ac17853969c /test/device.cxx | |
| parent | 0a1eed150a9d9215f70f1e50db2ec555199aee7d (diff) | |
Add static void Fl_Surface_Device::push_current(Fl_Surface_Device *new_current) and pop_current() to set/unset the current drawing surface.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12140 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'test/device.cxx')
| -rw-r--r-- | test/device.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/test/device.cxx b/test/device.cxx index 85d2f89ff..2fd2a9016 100644 --- a/test/device.cxx +++ b/test/device.cxx @@ -570,7 +570,7 @@ void copy(Fl_Widget *, void *data) { decorated = 0; } rgb_surf = new Fl_Image_Surface(W, H, 1); - rgb_surf->set_current(); + Fl_Surface_Device::push_current(rgb_surf); fl_color(FL_YELLOW);fl_rectf(0,0,W,H); if (decorated) rgb_surf->draw_decorated_window(target->as_window()); @@ -578,7 +578,7 @@ void copy(Fl_Widget *, void *data) { rgb_surf->draw(target); Fl_Image *img = rgb_surf->highres_image(); delete rgb_surf; - Fl_Display_Device::display_device()->set_current(); + Fl_Surface_Device::pop_current(); if (img) { Fl_Window* g2 = new Fl_Window(img->w()+10, img->h()+10); g2->color(FL_YELLOW); @@ -596,17 +596,17 @@ void copy(Fl_Widget *, void *data) { Fl_Copy_Surface *copy_surf; if (target->as_window() && !target->parent()) { copy_surf = new Fl_Copy_Surface(target->as_window()->decorated_w(), target->as_window()->decorated_h()); - copy_surf->set_current(); + Fl_Surface_Device::push_current(copy_surf); copy_surf->draw_decorated_window(target->as_window(), 0, 0); } else { copy_surf = new Fl_Copy_Surface(target->w()+10, target->h()+20); - copy_surf->set_current(); + Fl_Surface_Device::push_current(copy_surf); fl_color(FL_YELLOW);fl_rectf(0,0,copy_surf->w(), copy_surf->h()); copy_surf->draw(target, 5, 10); } delete copy_surf; - Fl_Display_Device::display_device()->set_current(); + Fl_Surface_Device::pop_current(); } if (strcmp(operation, "Fl_Printer") == 0 || strcmp(operation, "Fl_PostScript_File_Device") == 0) { |
