diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-10-31 14:20:04 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2021-10-31 14:20:04 +0100 |
| commit | 995a48dd003b51291bb1f2c5513c529a1ad8dfed (patch) | |
| tree | 8023e155595160449e08b3d562d6667389c45dc3 /src | |
| parent | 96034b565769fc0e3333e1830d053c732f4178f3 (diff) | |
Consistently make Fl_Paged_Device::begin_page call Fl_Surface_Device::push_current.
Diffstat (limited to 'src')
| -rw-r--r-- | src/Fl_Paged_Device.cxx | 2 | ||||
| -rw-r--r-- | src/drivers/PostScript/Fl_PostScript.cxx | 5 | ||||
| -rw-r--r-- | src/drivers/WinAPI/Fl_WinAPI_Printer_Driver.cxx | 4 |
3 files changed, 6 insertions, 5 deletions
diff --git a/src/Fl_Paged_Device.cxx b/src/Fl_Paged_Device.cxx index 368e09856..3eb250aab 100644 --- a/src/Fl_Paged_Device.cxx +++ b/src/Fl_Paged_Device.cxx @@ -40,6 +40,7 @@ int Fl_Paged_Device::begin_job(int pagecount, int *frompage, int *topage, char * The page coordinates are initially in points, i.e., 1/72 inch, and with origin at the top left of the printable page area. + This function also makes this surface the current drawing surface with Fl_Surface_Device::push_current(). \return 0 if OK, non-zero if any error */ int Fl_Paged_Device::begin_page (void) {return 1;} @@ -82,6 +83,7 @@ void Fl_Paged_Device::rotate(float angle) {} /** \brief To be called at the end of each page. + This function also stops this surface from being the current drawing surface with Fl_Surface_Device::pop_current(). \return 0 if OK, non-zero if any error. */ diff --git a/src/drivers/PostScript/Fl_PostScript.cxx b/src/drivers/PostScript/Fl_PostScript.cxx index 470f6df83..515450ce1 100644 --- a/src/drivers/PostScript/Fl_PostScript.cxx +++ b/src/drivers/PostScript/Fl_PostScript.cxx @@ -60,7 +60,6 @@ int Fl_PostScript_File_Device::begin_job (int pagecount, enum Fl_Paged_Device::P if(ps->output == NULL) return 2; ps->ps_filename_ = fl_strdup(fnfc.filename()); ps->start_postscript(pagecount, format, layout); - Fl_Surface_Device::push_current(this); return 0; } @@ -79,7 +78,6 @@ int Fl_PostScript_File_Device::begin_job (FILE *ps_output, int pagecount, ps->ps_filename_ = NULL; ps->start_postscript(pagecount, format, layout); ps->close_command(dont_close); // so that end_job() doesn't close the file - Fl_Surface_Device::push_current(this); return 0; } @@ -1592,6 +1590,7 @@ void Fl_PostScript_File_Device::untranslate(void) int Fl_PostScript_File_Device::begin_page (void) { Fl_PostScript_Graphics_Driver *ps = driver(); + Fl_Surface_Device::push_current(this); #if USE_PANGO cairo_ps_surface_dsc_begin_page_setup(cairo_get_target(ps->cr())); char feature[200]; @@ -1631,6 +1630,7 @@ int Fl_PostScript_File_Device::end_page (void) cairo_show_page(ps->cr()); ps->check_status(); #endif + Fl_Surface_Device::pop_current(); return 0; } @@ -1670,7 +1670,6 @@ void Fl_PostScript_File_Device::end_job (void) ps->clip_= ps->clip_->prev; delete c; } - Fl_Surface_Device::pop_current(); int err2 = (ps->close_cmd_ ? (ps->close_cmd_)(ps->output) : fclose(ps->output) ); if (!error) error = err2; if (error && ps->close_cmd_ == NULL) { diff --git a/src/drivers/WinAPI/Fl_WinAPI_Printer_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Printer_Driver.cxx index 2e808f1f5..a92600d91 100644 --- a/src/drivers/WinAPI/Fl_WinAPI_Printer_Driver.cxx +++ b/src/drivers/WinAPI/Fl_WinAPI_Printer_Driver.cxx @@ -152,14 +152,12 @@ int Fl_WinAPI_Printer_Driver::begin_job (int pagecount, int *frompage, int *topa y_offset = 0; WIN_SetupPrinterDeviceContext (hPr); driver()->gc(hPr); - this->set_current(); } return err; } void Fl_WinAPI_Printer_Driver::end_job (void) { - Fl_Display_Device::display_device()->set_current(); if (hPr != NULL) { if (! abortPrint) { prerr = EndDoc (hPr); @@ -232,6 +230,7 @@ int Fl_WinAPI_Printer_Driver::begin_page (void) rsult = 0; if (hPr != NULL) { + Fl_Surface_Device::push_current(this); WIN_SetupPrinterDeviceContext (hPr); prerr = StartPage (hPr); if (prerr < 0) { @@ -280,6 +279,7 @@ int Fl_WinAPI_Printer_Driver::end_page (void) rsult = 0; if (hPr != NULL) { + Fl_Surface_Device::pop_current(); prerr = EndPage (hPr); if (prerr < 0) { abortPrint = TRUE; |
