24#include "ROOT/RText.hxx"
25#include "ROOT/RBox.hxx"
32 auto canvas = RCanvas::Create(
"RText align example");
34 auto box = canvas->Add<RBox>(
RPadPos(0.1_normal, 0.1_normal),
RPadPos(0.9_normal, 0.9_normal));
35 box->border.style = RAttrLine::kStyle6;
37 auto drawText = [&canvas](
double x,
double y,
RAttrText::EAlign align,
const std::string &lbl) {
39 dbox->fill.color = RColor::kRed;
40 dbox->fill.style = RAttrFill::kSolid;
43 text->text.size = 0.07;
44 text->text.align = align;
47 drawText(0.1, 0.9, RAttrText::kLeftTop,
"kLeftTop");
49 drawText(0.1, 0.5, RAttrText::kLeftCenter,
"kLeftCenter");
51 drawText(0.1, 0.1, RAttrText::kLeftBottom,
"kLeftBottom");
53 drawText(0.9, 0.9, RAttrText::kRightTop,
"kRightTop");
55 drawText(0.9, 0.5, RAttrText::kRightCenter,
"kRightCenter");
57 drawText(0.9, 0.1, RAttrText::kRightBottom,
"kRightBottom");
59 drawText(0.5, 0.5, RAttrText::kCenter,
"kCenter");
61 drawText(0.5, 0.9, RAttrText::kCenterTop,
"kCenterTop");
63 drawText(0.5, 0.1, RAttrText::kCenterBottom,
"kCenterBottom");
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)