diff --git a/graf2d/gpad/src/TPad.cxx b/graf2d/gpad/src/TPad.cxx index 66cb2d9370da6..c73d996d5e070 100644 --- a/graf2d/gpad/src/TPad.cxx +++ b/graf2d/gpad/src/TPad.cxx @@ -5086,7 +5086,7 @@ void TPad::Print(const char *filename, Option_t *option) if (!title && strstr(opt,"svg")) { gVirtualPS = (TVirtualPS*)gROOT->GetListOfSpecials()->FindObject(psname); - Bool_t noScreen = kFALSE; + Bool_t noScreen = kFALSE, wasModified = IsModified(); if (!GetCanvas()->IsBatch() && GetCanvas()->GetCanvasID() == -1) { noScreen = kTRUE; GetCanvas()->SetBatch(kTRUE); @@ -5114,6 +5114,8 @@ void TPad::Print(const char *filename, Option_t *option) Paint(); if (noScreen) GetCanvas()->SetBatch(kFALSE); + if (wasModified && !IsBatch()) + Modified(kTRUE); if (!gSystem->AccessPathName(psname)) Info("Print", "SVG file %s has been created", psname.Data()); @@ -5128,7 +5130,7 @@ void TPad::Print(const char *filename, Option_t *option) if (!title && (strstr(opt,"tex") || strstr(opt,"Standalone"))) { gVirtualPS = (TVirtualPS*)gROOT->GetListOfSpecials()->FindObject(psname); - Bool_t noScreen = kFALSE; + Bool_t noScreen = kFALSE, wasModified = IsModified(); if (!GetCanvas()->IsBatch() && GetCanvas()->GetCanvasID() == -1) { noScreen = kTRUE; GetCanvas()->SetBatch(kTRUE); @@ -5157,7 +5159,10 @@ void TPad::Print(const char *filename, Option_t *option) gVirtualPS->NewPage(); } Paint(); - if (noScreen) GetCanvas()->SetBatch(kFALSE); + if (noScreen) + GetCanvas()->SetBatch(kFALSE); + if (wasModified && !IsBatch()) + Modified(kTRUE); if (!gSystem->AccessPathName(psname)) { if (standalone) { @@ -5192,7 +5197,7 @@ void TPad::Print(const char *filename, Option_t *option) if (copen || copenb) mustClose = kFALSE; if (cclose || ccloseb) mustClose = kTRUE; - Bool_t noScreen = kFALSE; + Bool_t noScreen = kFALSE, wasModified = IsModified(); if (!GetCanvas()->IsBatch() && GetCanvas()->GetCanvasID() == -1) { noScreen = kTRUE; GetCanvas()->SetBatch(kTRUE); @@ -5283,6 +5288,9 @@ void TPad::Print(const char *filename, Option_t *option) } } + if (wasModified && !IsBatch()) + Modified(kTRUE); + if (strstr(opt,"Preview")) gSystem->Exec(TString::Format("epstool --quiet -t6p %s %s", psname.Data(), psname.Data()).Data()); if (strstr(opt,"EmbedFonts")) {