Skip to content

Commit

Permalink
Fix calculation logic for multi-column overflow rects
Browse files Browse the repository at this point in the history
  • Loading branch information
sammycage committed Dec 12, 2024
1 parent 84e5618 commit 80ccb1b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions source/layout/boxview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ bool BoxView::isPrintMedia() const
float BoxView::availableWidth() const
{
if(m_currentPage)
return m_currentPage->width();
return m_currentPage->width() - m_currentPage->marginWidth();
return document()->viewportWidth();
}

std::optional<float> BoxView::availableHeight() const
{
if(m_currentPage)
return m_currentPage->height();
return m_currentPage->height() - m_currentPage->marginHeight();
return document()->viewportHeight();
}

Expand Down
4 changes: 3 additions & 1 deletion source/layout/multicolumnbox.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ MultiColumnRowBox* MultiColumnRowBox::create(MultiColumnFlowBox* columnFlow, con
void MultiColumnRowBox::updateOverflowRect()
{
BoxFrame::updateOverflowRect();
addOverflowRect(columnRectAt(numberOfColumns() - 1));
auto columnRect = columnRectAt(numberOfColumns() - 1);
auto overflowRect = m_columnFlowBox->visualOverflowRect().moved(columnRect.origin());
addOverflowRect(columnRect.y, columnRect.bottom(), overflowRect.x, overflowRect.right());
}

MultiColumnRowBox::MultiColumnRowBox(MultiColumnFlowBox* columnFlow, const RefPtr<BoxStyle>& style)
Expand Down

0 comments on commit 80ccb1b

Please sign in to comment.