本文整理汇总了C++中InlineBox::isLineBreak方法的典型用法代码示例。如果您正苦于以下问题:C++ InlineBox::isLineBreak方法的具体用法?C++ InlineBox::isLineBreak怎么用?C++ InlineBox::isLineBreak使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InlineBox
的用法示例。
在下文中一共展示了InlineBox::isLineBreak方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: prevLeafChildIgnoringLineBreak
InlineBox* InlineBox::prevLeafChildIgnoringLineBreak() const
{
InlineBox* leaf = prevLeafChild();
if (leaf && leaf->isLineBreak())
return 0;
return leaf;
}
示例2: closestLeafChildForLogicalLeftPosition
InlineBox* RootInlineBox::closestLeafChildForLogicalLeftPosition(int leftPosition, bool onlyEditableLeaves)
{
InlineBox* firstLeaf = firstLeafChild();
InlineBox* lastLeaf = lastLeafChild();
if (firstLeaf != lastLeaf) {
if (firstLeaf->isLineBreak())
firstLeaf = firstLeaf->nextLeafChildIgnoringLineBreak();
else if (lastLeaf->isLineBreak())
lastLeaf = lastLeaf->prevLeafChildIgnoringLineBreak();
}
if (firstLeaf == lastLeaf && (!onlyEditableLeaves || isEditableLeaf(firstLeaf)))
return firstLeaf;
// Avoid returning a list marker when possible.
if (leftPosition <= firstLeaf->logicalLeft() && !firstLeaf->renderer().isListMarker() && (!onlyEditableLeaves || isEditableLeaf(firstLeaf)))
// The leftPosition coordinate is less or equal to left edge of the firstLeaf.
// Return it.
return firstLeaf;
if (leftPosition >= lastLeaf->logicalRight() && !lastLeaf->renderer().isListMarker() && (!onlyEditableLeaves || isEditableLeaf(lastLeaf)))
// The leftPosition coordinate is greater or equal to right edge of the lastLeaf.
// Return it.
return lastLeaf;
InlineBox* closestLeaf = 0;
for (InlineBox* leaf = firstLeaf; leaf; leaf = leaf->nextLeafChildIgnoringLineBreak()) {
if (!leaf->renderer().isListMarker() && (!onlyEditableLeaves || isEditableLeaf(leaf))) {
closestLeaf = leaf;
if (leftPosition < leaf->logicalRight())
// The x coordinate is less than the right edge of the box.
// Return it.
return leaf;
}
}
return closestLeaf ? closestLeaf : lastLeaf;
}
示例3: prevLeafChildIgnoringLineBreak
InlineBox* InlineBox::prevLeafChildIgnoringLineBreak() const
{
InlineBox* leaf = prevLeafChild();
return (leaf && leaf->isLineBreak()) ? nullptr : leaf;
}