本文整理汇总了C++中TextLine::diagonal方法的典型用法代码示例。如果您正苦于以下问题:C++ TextLine::diagonal方法的具体用法?C++ TextLine::diagonal怎么用?C++ TextLine::diagonal使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TextLine
的用法示例。
在下文中一共展示了TextLine::diagonal方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: if
void TextLineSegment::layout1()
{
TextLine* tl = textLine();
if (!tl->diagonal())
_userOff2.setY(0);
switch (subtype()) {
case SEGMENT_SINGLE:
case SEGMENT_BEGIN:
if (tl->beginText()) {
if (_text == 0) {
_text = new Text(*tl->beginText());
_text->setFlag(ELEMENT_MOVABLE, false);
_text->setParent(this);
}
}
else {
delete _text;
_text = 0;
}
break;
case SEGMENT_MIDDLE:
case SEGMENT_END:
if (tl->continueText()) {
if (_text == 0) {
_text = new Text(*tl->continueText());
_text->setFlag(ELEMENT_MOVABLE, false);
_text->setParent(this);
}
}
else {
delete _text;
_text = 0;
}
break;
}
if (_text)
_text->layout();
QPointF pp1;
QPointF pp2(pos2());
if (!_text && pp2.y() != 0) {
setbbox(QRectF(pp1, pp2).normalized());
return;
}
qreal y1 = point(-textLine()->lineWidth());
qreal y2 = -y1;
int sym = textLine()->beginSymbol();
if (_text) {
qreal h = _text->height();
if (textLine()->beginTextPlace() == PLACE_ABOVE)
y1 = -h;
else if (textLine()->beginTextPlace() == PLACE_BELOW)
y2 = h;
else {
y1 = -h * .5;
y2 = h * .5;
}
}
else if (sym != -1) {
qreal hh = symbols[score()->symIdx()][sym].height(magS()) * .5;
y1 = -hh;
y2 = hh;
}
if (textLine()->endHook()) {
qreal h = point(textLine()->endHookHeight());
if (h > y2)
y2 = h;
else if (h < y1)
y1 = h;
}
if (textLine()->beginHook()) {
qreal h = point(textLine()->beginHookHeight());
if (h > y2)
y2 = h;
else if (h < y1)
y1 = h;
}
bbox().setRect(.0, y1, pp2.x(), y2 - y1);
}