Fill color for TPaveText with ARC option

Hello,

I don’t manage to have control of the background color of a TPaveText when the “ARC” option is enabled. No problem, though, when it’s not passed. Here is a MWE:

#include "TCanvas.h"
#include "TPaveText.h"

int main() {

    TPaveText pavetext(0.15, 0.5, 0.9, 0.9, "NDC");
    pavetext.SetTextColor(kGray);
    pavetext.SetFillColor(kBlue);
    pavetext.SetLineColor(kRed);
    pavetext.SetBorderSize(10);
    pavetext.SetLineWidth(10);
    pavetext.AddText("option NDC only");

    TPaveText pavetext2(0.15, 0.15, 0.9, 0.45, "NDC ARC");
	pavetext2.SetCornerRadius(0.1);
    pavetext2.SetTextColor(kGray);
    pavetext2.SetFillColor(kBlue);
    pavetext2.SetLineColor(kRed);
    pavetext2.SetBorderSize(10);
    pavetext2.SetLineWidth(10);
    pavetext2.AddText("option NDC ARC");

    TCanvas canvas("canvas", "MWE canvas", 1600, 1200);
    pavetext.Draw();
    pavetext2.Draw();

    canvas.SaveAs("pavetext_bug_arc.png");
}


even though I use the exact same commands for both pavetexts.

It seems that if a custom TStyle is used, where TStyle::SetLineColor() is defined, for some reason, the TPaveText object with “ARC” takes this color as the background one.
Would anyone know how to control this color? Or is it a bug?

Cheers,
Tristan


ROOT Version: 6.32.02
Platform: Ubuntu 22.04
Compiler: linuxx8664gcc


Hi Tristan,

Thanks for the post. I can reproduce even with master. @couet do you know perhaps why this is the case?

Cheers,
Danilo

Hi @Tristan ,

Yes I see the same. I am debugging.
Cheers,
Olivier

Hi Olivier,

There are more artifacts with rounded corners of TPave.
If one enables border drawing with “blNDC ARC” option, one sees:
pave_arc

Regards,
Sergey

Hi Sergey, I am on it. thanks.

I create macro which demonstrates other problem.

pave_arc.cxx.txt (1.2 KB)

First of all, border with arc.
But also border not seen at all, if line width larger than border size.

Thanks, I am now looking at the color problem. One thing after each other

I am still investigting. I found out that if add the option BR:

    TPaveText pavetext2(0.15, 0.15, 0.9, 0.45, "NDC BR ARC");

it works

I also noticed that SetBorderSize(1) (or any nonzero value) if “BR” is not passed as an option gives this black background; However, "NDC ARC" with SetBorderSize(0) sets the background to the correct color. I wonder if somehow the shadow color is not applied as the background color if the border is nonzero and without option regarding the borders type?

Apologies for the delay in identifying the issue. Initially, I suspected it might be related to color handling or something similar. However, the root cause turned out to be improper handling of the drawing options, as addressed in this PR. Specifically, the shadow, in case the ARC option, completely obscured the pave drawing. Thank you for noticing this! The issue has been resolved by the previously mentioned PR.