Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1221)

Unified Diff: Source/core/layout/MultiColumnFragmentainerGroup.cpp

Issue 1102273004: [New Multicolumn] flowThreadTranslationAtOffset() needs to be relative to the flow thread. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/layout/MultiColumnFragmentainerGroup.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/MultiColumnFragmentainerGroup.cpp
diff --git a/Source/core/layout/MultiColumnFragmentainerGroup.cpp b/Source/core/layout/MultiColumnFragmentainerGroup.cpp
index 08fc0e400897fcbbfd0cc29e1c4ad59ced5f5211..3ac09784403acfe7295ab163ebeb33bd4288da01 100644
--- a/Source/core/layout/MultiColumnFragmentainerGroup.cpp
+++ b/Source/core/layout/MultiColumnFragmentainerGroup.cpp
@@ -135,9 +135,9 @@ LayoutSize MultiColumnFragmentainerGroup::flowThreadTranslationAtOffset(LayoutUn
unsigned columnIndex = columnIndexAtOffset(offsetInFlowThread);
LayoutRect portionRect(flowThreadPortionRectAt(columnIndex));
m_columnSet.flipForWritingMode(portionRect);
- LayoutRect columnRect(columnRectAt(columnIndex));
- m_columnSet.flipForWritingMode(columnRect);
- return columnRect.location() - portionRect.location();
+ LayoutSize translation(translationAtColumn(columnIndex));
+ // TODO(mstensho): need a rectangle (not a point) to flip for writing mode here, once we get support for multiple rows.
+ return toLayoutPoint(translation) - portionRect.location();
}
LayoutUnit MultiColumnFragmentainerGroup::columnLogicalTopForOffset(LayoutUnit offsetInFlowThread) const
@@ -438,6 +438,23 @@ LayoutUnit MultiColumnFragmentainerGroup::calculateColumnHeight(BalancedColumnHe
return m_columnHeight + m_minSpaceShortage;
}
+LayoutSize MultiColumnFragmentainerGroup::translationAtColumn(unsigned columnIndex) const
+{
+ LayoutUnit logicalTopOffset;
+ LayoutUnit logicalLeftOffset;
+ LayoutUnit columnGap = m_columnSet.columnGap();
+ if (m_columnSet.multiColumnFlowThread()->progressionIsInline()) {
+ logicalLeftOffset = columnIndex * (m_columnSet.pageLogicalWidth() + columnGap);
+ if (!m_columnSet.style()->isLeftToRightDirection())
+ logicalLeftOffset = -logicalLeftOffset;
+ } else {
+ logicalTopOffset = columnIndex * (m_columnHeight + columnGap);
+ }
+
+ LayoutSize offset(logicalLeftOffset, logicalTopOffset);
+ return m_columnSet.isHorizontalWritingMode() ? offset : offset.transposedSize();
+}
+
LayoutRect MultiColumnFragmentainerGroup::columnRectAt(unsigned columnIndex) const
{
LayoutUnit columnLogicalWidth = m_columnSet.pageLogicalWidth();
« no previous file with comments | « Source/core/layout/MultiColumnFragmentainerGroup.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698