This macro demonstrate the text align attribute for RText.
#include "ROOT/RText.hxx"
#include "ROOT/RBox.hxx"
{
auto canvas = RCanvas::Create("RText align example");
box->border.style = RAttrLine::kStyle6;
dbox->fill.color = RColor::kRed;
dbox->fill.style = RAttrFill::kSolid;
text->text.align = align;
};
drawText(0.1, 0.9, RAttrText::kLeftTop,
"kLeftTop");
drawText(0.1, 0.5, RAttrText::kLeftCenter,
"kLeftCenter");
drawText(0.1, 0.1, RAttrText::kLeftBottom,
"kLeftBottom");
drawText(0.9, 0.9, RAttrText::kRightTop,
"kRightTop");
drawText(0.9, 0.5, RAttrText::kRightCenter,
"kRightCenter");
drawText(0.9, 0.1, RAttrText::kRightBottom,
"kRightBottom");
drawText(0.5, 0.5, RAttrText::kCenter,
"kCenter");
drawText(0.5, 0.9, RAttrText::kCenterTop,
"kCenterTop");
drawText(0.5, 0.1, RAttrText::kCenterBottom,
"kCenterBottom");
canvas->Show();
}
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char text
A position (horizontal and vertical) in a RPad.
void box(Int_t pat, Double_t x1, Double_t y1, Double_t x2, Double_t y2)