本文整理汇总了C++中InlineFlowBox::width方法的典型用法代码示例。如果您正苦于以下问题:C++ InlineFlowBox::width方法的具体用法?C++ InlineFlowBox::width怎么用?C++ InlineFlowBox::width使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InlineFlowBox
的用法示例。
在下文中一共展示了InlineFlowBox::width方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: repositionGenericCue
void RenderTextTrackCue::repositionGenericCue()
{
ASSERT(firstChild());
InlineFlowBox* firstLineBox = toRenderInline(firstChild())->firstLineBox();
if (static_cast<TextTrackCueGeneric*>(m_cue)->useDefaultPosition() && firstLineBox) {
LayoutUnit parentWidth = containingBlock()->logicalWidth();
LayoutUnit width = firstLineBox->width();
LayoutUnit right = (parentWidth / 2) - (width / 2);
setX(right);
}
repositionCueSnapToLinesNotSet();
}
示例2: repositionGenericCue
void RenderTextTrackCue::repositionGenericCue()
{
TextTrackCueGeneric* cue = static_cast<TextTrackCueGeneric*>(m_cue);
if (!cue->useDefaultPosition())
return;
ASSERT(firstChild());
InlineFlowBox* firstLineBox = toRenderInline(firstChild())->firstLineBox();
if (!firstLineBox)
return;
LayoutUnit parentWidth = containingBlock()->logicalWidth();
LayoutUnit width = firstLineBox->width();
LayoutUnit right = (parentWidth / 2) - (width / 2);
setX(right);
}
示例3: caretPos
void RenderInline::caretPos(int offset, int flags, int &_x, int &_y, int &width, int &height)
{
_x = -1;
RenderBlock *cb = containingBlock();
bool rtl = cb->style()->direction() == RTL;
bool outsideEnd = flags & CFOutsideEnd;
// I need to explain that: outsideEnd contains a meaningful value if
// and only if flags & CFOutside is set. If it is not, then randomly
// either the first or the last line box is returned.
// This doesn't matter because the only case this can happen is on an
// empty inline element, whose first and last line boxes are actually
// the same.
InlineFlowBox *line = !outsideEnd ^ rtl ? firstLineBox() : lastLineBox();
if(!line)
{ // umpf, handle "gracefully"
RenderFlow::caretPos(offset, flags, _x, _y, width, height);
return;
}
_x = line->xPos();
width = 1; // ### regard CFOverride
// Place caret outside the border
if(flags & CFOutside)
{
RenderStyle *s = element() && element()->parent() && element()->parent()->renderer() ? element()->parent()->renderer()->style() : style();
const QFontMetrics &fm = s->fontMetrics();
_y = line->yPos() + line->baseline() - fm.ascent();
height = fm.height();
if(!outsideEnd ^ rtl)
{
_x -= line->marginBorderPaddingLeft();
}
else
{
_x += line->width() + line->marginBorderPaddingRight();
}
}
else
{
const QFontMetrics &fm = style()->fontMetrics();
_y = line->yPos() + line->baseline() - fm.ascent();
height = fm.height();
}
int absx, absy;
if(cb && cb->absolutePosition(absx, absy))
{
// kdDebug(6040) << "absx=" << absx << " absy=" << absy << endl;
_x += absx;
_y += absy;
}
else
{
// we don't know our absolute position, and there is no point returning
// just a relative one
_x = _y = -1;
}
}
示例4: absoluteQuads
void RenderSVGInline::absoluteQuads(Vector<FloatQuad>& quads)
{
const RenderObject* object = SVGRenderSupport::findTextRootObject(this);
if (!object)
return;
FloatRect textBoundingBox = object->strokeBoundingBox();
for (InlineFlowBox* box = firstLineBox(); box; box = box->nextLineBox())
quads.append(localToAbsoluteQuad(FloatRect(textBoundingBox.x() + box->x(), textBoundingBox.y() + box->y(), box->width(), box->height())));
}