This macro demonstrate the text align attribute for RText.
#include "ROOT/RText.hxx"
#include "ROOT/RBox.hxx"
void rtext_align()
{
auto box = canvas->Add<RBox>(
RPadPos(0.1_normal, 0.1_normal),
RPadPos(0.9_normal, 0.9_normal));
auto drawText = [&canvas](
double x,
double y,
RAttrText::EAlign align,
const std::string &lbl) {
auto dbox = canvas->Add<RBox>(
RPadPos(
x - 0.003,
y - 0.003),
RPadPos(
x + 0.003,
y + 0.003));
text->text.align = align;
};
canvas->Show();
}
static std::shared_ptr< RCanvas > Create(const std::string &title)
Create new canvas instance.
static R__DLLEXPORT constexpr RGB_t kRed
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)
Namespace for ROOT features in testing.
- Date
- 2021-07-07
- Warning
- This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback is welcome!
- Author
- Sergey Linev s.lin.nosp@m.ev@g.nosp@m.si.de
Definition in file rtext_align.cxx.