Fix Fl_{Wayland|Xlib}_{Copy|Image}_Surface_Driver::set_current()
Member function Fl_Cairo_Graphics_Driver::set_cairo() needs be called only to initialize the driver. Doing it also later undoes the effect of Fl_Widget_Surface::translate() if used when Fl_Surface_Device::pop_current() calls the overridden Fl_Surface_Device::set_current().
This commit is contained in:
parent
c0c2cf7d40
commit
7bb8bdb1fa
@ -45,7 +45,8 @@ Fl_Wayland_Copy_Surface_Driver::~Fl_Wayland_Copy_Surface_Driver() {
|
||||
|
||||
void Fl_Wayland_Copy_Surface_Driver::set_current() {
|
||||
Fl_Surface_Device::set_current();
|
||||
((Fl_Wayland_Graphics_Driver*)driver())->set_cairo((cairo_t*)img_surf->offscreen());
|
||||
Fl_Cairo_Graphics_Driver *dr = (Fl_Cairo_Graphics_Driver*)driver();
|
||||
if (!dr->cr()) dr->set_cairo((cairo_t*)img_surf->offscreen());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -76,7 +76,8 @@ Fl_Wayland_Image_Surface_Driver::~Fl_Wayland_Image_Surface_Driver() {
|
||||
|
||||
void Fl_Wayland_Image_Surface_Driver::set_current() {
|
||||
Fl_Surface_Device::set_current();
|
||||
((Fl_Wayland_Graphics_Driver*)fl_graphics_driver)->set_cairo((cairo_t*)offscreen);
|
||||
Fl_Cairo_Graphics_Driver *dr = (Fl_Cairo_Graphics_Driver*)driver();
|
||||
if (!dr->cr()) dr->set_cairo((cairo_t*)offscreen);
|
||||
pre_window = Fl_Wayland_Window_Driver::wld_window;
|
||||
Fl_Wayland_Window_Driver::wld_window = NULL;
|
||||
fl_window = 0;
|
||||
|
||||
@ -78,7 +78,8 @@ void Fl_Xlib_Copy_Surface_Driver::set_current() {
|
||||
oldwindow = fl_window;
|
||||
fl_window = xid->offscreen();
|
||||
#if FLTK_USE_CAIRO
|
||||
((Fl_X11_Cairo_Graphics_Driver*)driver())->set_cairo(cairo_);
|
||||
Fl_Cairo_Graphics_Driver *dr = (Fl_Cairo_Graphics_Driver*)driver();
|
||||
if (!dr->cr()) dr->set_cairo(cairo_);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@ -82,7 +82,8 @@ void Fl_Xlib_Image_Surface_Driver::set_current() {
|
||||
pre_window = fl_window;
|
||||
fl_window = offscreen;
|
||||
#if FLTK_USE_CAIRO
|
||||
((Fl_X11_Cairo_Graphics_Driver*)driver())->set_cairo(cairo_);
|
||||
Fl_Cairo_Graphics_Driver *dr = (Fl_Cairo_Graphics_Driver*)driver();
|
||||
if (!dr->cr()) dr->set_cairo(cairo_);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user