コード例 #1
0
unsigned MultiColumnFragmentainerGroup::actualColumnCount() const
{
    // We must always return a value of 1 or greater. Column count = 0 is a meaningless situation,
    // and will confuse and cause problems in other parts of the code.
    if (!m_columnHeight)
        return 1;

    // Our flow thread portion determines our column count. We have as many columns as needed to fit
    // all the content.
    LayoutUnit flowThreadPortionHeight = logicalHeightInFlowThread();
    if (!flowThreadPortionHeight)
        return 1;

    unsigned count = ceil(flowThreadPortionHeight.toFloat() / m_columnHeight.toFloat());
    ASSERT(count >= 1);
    return count;
}
コード例 #2
0
unsigned MultiColumnFragmentainerGroup::actualColumnCount() const {
  // We must always return a value of 1 or greater. Column count = 0 is a
  // meaningless situation, and will confuse and cause problems in other parts
  // of the code.
  if (!m_columnHeight)
    return 1;

  // Our flow thread portion determines our column count. We have as many
  // columns as needed to fit all the content.
  LayoutUnit flowThreadPortionHeight = logicalHeightInFlowThread();
  if (!flowThreadPortionHeight)
    return 1;

  unsigned count = (flowThreadPortionHeight / m_columnHeight).floor();
  // flowThreadPortionHeight may be saturated, so detect the remainder manually.
  if (count * m_columnHeight < flowThreadPortionHeight)
    count++;
  ASSERT(count >= 1);
  return count;
}
コード例 #3
0
LayoutRect LayoutMultiColumnSet::flowThreadPortionRect() const
{
    LayoutRect portionRect(LayoutUnit(), logicalTopInFlowThread(), pageLogicalWidth(), logicalHeightInFlowThread());
    if (!isHorizontalWritingMode())
        return portionRect.transposedRect();
    return portionRect;
}