本文整理汇总了C++中Bracket::rypos方法的典型用法代码示例。如果您正苦于以下问题:C++ Bracket::rypos方法的具体用法?C++ Bracket::rypos怎么用?C++ Bracket::rypos使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bracket
的用法示例。
在下文中一共展示了Bracket::rypos方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
//.........这里部分代码省略.........
int spanTo = (score()->staff(lastStaffIdx)->lines() == 1) ?
BARLINE_SPAN_1LINESTAFF_TO :
(score()->staff(lastStaffIdx)->lines()-1)*2;
_barLine->setSpanTo(spanTo);
_barLine->layout();
}
//---------------------------------------------------
// layout brackets vertical position
//---------------------------------------------------
n = _brackets.size();
for (int i = 0; i < n; ++i) {
Bracket* b = _brackets.at(i);
int staffIdx1 = b->firstStaff();
int staffIdx2 = b->lastStaff();
qreal sy = 0; // assume bracket not visible
qreal ey = 0;
// if start staff not visible, try next staff
while (staffIdx1 <= staffIdx2 && !_staves[staffIdx1]->show())
++staffIdx1;
// if end staff not visible, try prev staff
while (staffIdx1 <= staffIdx2 && !_staves[staffIdx2]->show())
--staffIdx2;
// the bracket will be shown IF:
// it spans at least 2 visible staves (staffIdx1 < staffIdx2) OR
// it spans just one visible staff (staffIdx1 == staffIdx2) but it is required to do so
// (the second case happens at least when the bracket is initially dropped)
bool notHidden = (staffIdx1 < staffIdx2) || (b->span() == 1 && staffIdx1 == staffIdx2);
if (notHidden) { // set vert. pos. and height to visible spanned staves
sy = _staves[staffIdx1]->bbox().top();
ey = _staves[staffIdx2]->bbox().bottom();
}
b->rypos() = sy;
b->setHeight(ey - sy);
b->layout();
}
//---------------------------------------------------
// layout instrument names
//---------------------------------------------------
int staffIdx = 0;
n = score()->parts().size();
for (Part* p : score()->parts()) {
SysStaff* s = staff(staffIdx);
SysStaff* s2;
int nstaves = p->nstaves();
if (s->show()) {
for (InstrumentName* t : s->instrumentNames) {
//
// override Text->layout()
//
qreal y1, y2;
switch (t->layoutPos()) {
default:
case 0: // center at part
y1 = s->bbox().top();
s2 = staff(staffIdx);
for (int i = staffIdx + nstaves - 1; i > 0; --i) {
SysStaff* s = staff(i);
if (s->show()) {
s2 = s;
break;
}