TASImage, DrawRectangle and refreshing

Well, DrawText has it also. So it might simple be that it was forgotten in DrawRectangle. I am not the author of that code, that why I was very cautious. I’ll test and let you know.

The mod is now in the svn trunk.

I’ve compiled with new TASImage and after short testing seems to work. However, there is one bug (?):

After drawing primitive, palette is hidden. I assume, it should remain in the same state of visibility as before drawing primitive.

Another thing, however, is that it may be not that easy - as I mentioned I use AstroImage derived from TASImage. I tried to reenable palette myself after drawing primitive. It showed up, but with scale from 0 to 1, while before it has completely different scale…

Can you send an example macro showing this problem ?

Here it comes:

TASImage *a = new TASImage("paski2.gif"); a->Draw(); a->SetPaletteEnabled(1); gPad->Modified(); gPad->Update(); a->DrawBox(10, 10, 100, 100, "#AAAAAA", 2); gPad->Modified(); gPad->Update(); a->SetPaletteEnabled(1); gPad->Modified(); gPad->Update();

  1. After first gPad->Update() I make palette visible
  2. after second gPad->Update() it becomes invisible
  3. after third, I manually make it visible again but… it’s different than before.

I suppose that, like before, all this should be done in interactive mode and if you put all this in a macro it works fine ? right ?

It shows exactly the same behaviour in interactive and in macro mode (and in compiled it seems).

  1. … that’s fine, that’s what we want…(note that gPad->Modified() does the job no need for gPad->Update()).

  2. After the second gPad->Modified() I agree it disappears. But I am not sure if that’s wrong. It might be the right behavior. The Palette might be aimed to be not part of the picture but is just a tool to see temporarily the color map.

  3. for me the palette appearing there is the same as before.

Well, so I am not sure either :slight_smile: However, theoretically if you just add primitive and the only change you want is to see that primitive drawn, nothing else should change. But you may be right… just maybe worth mentioning in some docs.

Here numbers are the same, but colors are different. If everything is fine in your version, maybe it’s just my version of ROOT. I just updated TASImage, not whole tree. I’ll try with the whole tree…

colors are the same for me …

Hi ROOTers,

although the bug is supposed to be fixed I still have the same problem (ROOT 5.24). This code works interpreted but not compiled:

TASImage* img = new TASImage("earthris.gif"); img->DrawRectangle(10, 10, 50, 50, "0xFFFFFF", 3); img->Draw("N");

Also other DrawXYZ functions do not work. Or am I doing something wrong here? Thank you in advance,

Daniel

Could you post a short script working with the interpreter and not the compiler?

Rene