54 for(
auto& i:document.
pages){
58 mw += float(back->w())*scale;
59 mh = std::max(mh,
float(back->h())*scale);
62 float k = std::min(1.f,
float(800.f+
float(document.
margins.xMargin()))*scale/std::max(mw,1.f));
64 int x = (w()-int(k*mw))/2, y = (h()-int(mh))/2;
68 for(
auto& i:document.
pages) {
80 mgr.left = int(
float(mgr.left) *scale);
81 mgr.right = int(
float(mgr.right) *scale);
82 mgr.top = int(
float(mgr.top) *scale);
83 mgr.bottom = int(
float(mgr.bottom)*scale);
85 const int w = int(k*scale*
float(back->w()));
86 const int h = int( scale*
float(back->h()));
90 0,0,back->w(),back->h());
92 p.setBrush(Color(0.04f,0.04f,0.04f,1));
98 i.text, Tempest::AlignLeft);
100 if(document.
showPlayer && cursor!=
nullptr && pl!=
nullptr) {
101 auto pos = pl->position();
102 float wx = (pos.x-float(document.
wbounds.x))/
float(document.
wbounds.w);
103 float wy = (pos.z-float(document.
wbounds.y))/
float(document.
wbounds.h);
106 int cx = x+int(wx*
float(w));
107 int cy = y+int(wy*
float(h));
111 p.rotate(-pl->rotation());
112 p.drawRect(-cursor->w()/2,-cursor->h()/2, cursor->w(),cursor->h());
void drawText(Tempest::Painter &p, int x, int y, int w, int h, std::string_view txt, Tempest::AlignFlag align, int firstLine=0) const