20 #undef CLASSDESC_ARITIES 21 #define CLASSDESC_ARITIES 0x3f 44 bottomRowMargin.clear();
47 const double rowHeight=cell(0,0).height();
48 for (
unsigned i=0; i<numRows(); ++i)
49 bottomRowMargin.push_back((i+1)*rowHeight);
54 for (
unsigned i=0; i<numRows(); ++i)
57 for (
unsigned j=0; j<numCols(); ++j)
58 rowHeight=std::max(rowHeight, cell(i,j).height());
60 bottomRowMargin.push_back(y);
63 assert(bottomRowMargin.size()==numRows());
65 rightColMargin.clear();
67 for (
unsigned col=0; col<numCols(); ++col)
69 double colWidth=0, y=0;
70 switch (justification(col))
72 case right:
case centre:
74 for (
unsigned row=0; row<numRows(); ++row)
75 colWidth=std::max(colWidth,cell(row,col).width()+
padx);
82 for (
unsigned row=0; row<numRows(); ++row)
84 auto& currentCell=cell(row,col);
86 switch (justification(col))
89 case right: offset+=colWidth-currentCell.width();
break;
90 case centre: offset+=0.5*(colWidth-currentCell.width());
break;
92 moveCursorTo(x+offset+0.5*
padx,y);
94 colWidth=std::max(colWidth, currentCell.width()+
padx);
95 y=bottomRowMargin[row];
98 rightColMargin.push_back(x);
102 template <
class Cell>
105 if (rightColMargin.empty() || x<0 || x>=rightColMargin.back())
107 auto p=std::upper_bound(rightColMargin.begin(), rightColMargin.end(), x);
108 return p-rightColMargin.begin();
111 template <
class Cell>
114 if (bottomRowMargin.empty() || y<0 || y>=bottomRowMargin.back())
116 auto p=std::upper_bound(bottomRowMargin.begin(), bottomRowMargin.end(), y);
117 return p-bottomRowMargin.begin();
constexpr double padx
padding between cells
int colX(double x) const
column at x in unzoomed coordinates
Creation and access to the minskyTCL_obj object, which has code to record whenever Minsky's state cha...
int rowY(double y) const
row at y in unzoomed coordinates
CLASSDESC_ACCESS_EXPLICIT_INSTANTIATION(minsky::Grid< minsky::ICell >)