Bug (?) in TCanvas::SaveSource()

Dear all,

I have a compiled macro where I tried to use the method TCanvas::SaveSource();

The Canvas, among many other things, holds a TPaveText object with a few lines of text.
When reprocessing with CINT the ‘.C’ file obatined, this object is not present.

If I save the Canvas manually from the window menu the problem doesn’t occur.

By diffing the 2 source file I see:

[code]< TPaveText *pt = new TPaveText(0.12,0.58,0.32,0.88,“brNDC”);

TPaveText *pt = new TPaveText(-6.96253e+87,-5.51628e+116,-4.37045e+145,-3.46263e+174,“brNDC”);[/code]

where the first one is the working source. Clearly (to me) the pave is saved with senseless coordinates when done by calling the method in the macro.

Did anybody hit such a strange problem before?

saluti
Davide

Could you send a short script reproducing this problem? I cannot

Rene

Dear Rene,

I managed to extract a few lines from my code into a dummy macro (prova.C) that reproduces the problem when fed to CINT.
The other file is the one saved by TCanvas::SaveSource();

Actually I also discovered by chance that calling TCanvas::Update() before TCanvas::SaveSource(); actually solves the problem.
I don’t really understand why (without the Update()) ROOT is able to draw the TPaveTaxt correctly but not to save it to file, but maybe it’s not so important.

Thanks anyhow
Davide
prova.C (1.28 KB)
led_fit_run13_ch2.C (1.6 KB)

Davide,

see explanations in root.cern.ch/root/HowtoDraw.html

Rene