Minsky
anonymous_namespace{sheet.cc}::ClippedPango Struct Reference

A pango that clips text to a standard area suitable for numbers. More...

Inheritance diagram for anonymous_namespace{sheet.cc}::ClippedPango:
Inheritance graph
Collaboration diagram for anonymous_namespace{sheet.cc}::ClippedPango:
Collaboration graph

Public Member Functions

 ClippedPango (cairo_t *cairo)
 
void show ()
 

Public Attributes

double m_width
 
double m_height
 

Detailed Description

A pango that clips text to a standard area suitable for numbers.

Definition at line 273 of file sheet.cc.

Constructor & Destructor Documentation

◆ ClippedPango()

anonymous_namespace{sheet.cc}::ClippedPango::ClippedPango ( cairo_t *  cairo)
inline

Definition at line 276 of file sheet.cc.

References minsky::str().

276  : Pango(cairo) {
277  setText(str(-std::numeric_limits<double>::max()));
278  m_width=5+width();
279  m_height=height();
280  }
std::string str(T x)
utility function to create a string representation of a numeric type
Definition: str.h:33
Here is the call graph for this function:

Member Function Documentation

◆ show()

void anonymous_namespace{sheet.cc}::ClippedPango::show ( )
inline

Definition at line 281 of file sheet.cc.

281  {
282  const cairo::CairoSave cs(cairoContext());
283  double x,y;
284  cairo_get_current_point(cairoContext(),&x,&y);
285  cairo_rectangle(cairoContext(),x,y,m_width,m_height);
286  cairo_clip(cairoContext());
287  cairo_move_to(cairoContext(),x,y);
288  Pango::show();
289  }

Member Data Documentation

◆ m_height

double anonymous_namespace{sheet.cc}::ClippedPango::m_height

Definition at line 275 of file sheet.cc.

◆ m_width

double anonymous_namespace{sheet.cc}::ClippedPango::m_width

Definition at line 275 of file sheet.cc.


The documentation for this struct was generated from the following file: